Mysterious Mullions

Hi,

I am struggling with trying to create mullions on a curtain wall, using a spreadsheet as data. Am using a Python script to create the mullions and Dynamo nodes for the rest.

The issue is when I try to connect the output of a dictionary to the Python script, it will give me an error:

But, if I just plug in the name to the FamilyType.ByName node, it will work fine:

Python script (found on this forum):

# Load the Python Standard and DesignScript Libraries
import sys
import clr

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import ToDSType(bool) extension method

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.

#Variables
doc = DocumentManager.Instance.CurrentDBDocument
grids = UnwrapElement(IN[0])
mullType = UnwrapElement(IN[1])
mullions = []

#Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

#Add Mullion to Grid Line
for g in grids:
	mullions.append(g.AddMullions(g.FullCurve,doc.GetElement(mullType.Id),False))

#Stop Transaction
TransactionManager.Instance.TransactionTaskDone()

OUT = mullions

My hunch is that there is something in the dictionary output that makes it error, but it looks totally fine. I tried a Flatten after the dictionary, but same error. Have also played around with Lacing, but same issue.

Any insight is appreciated.

Thanks,
@lorhal

Hello,
try this


for g, mType in zip(grids, mullType):
	mullions.append(g.AddMullions(g.FullCurve, mType, False))
1 Like

Hi @c.poupin ,

Sorry for the delay. Did not get the notification for some reason.
It worked!! Once again you saved the day.

Just to narrate this solution: By zipping together the grid and mullion type, the script was able keep things together as it was being processed. Also, because I used the GetFamilyTypeByName node, there was no need to use doc.GetElement(mullType.Id).

Best,

@lorhal

1 Like