Hello,
I have a graph to batch copy family parameters from one family to a number of other family documents using “FamilyParameter.Create” from the Orchid Package.
The parameter names, types and groups of the source parameters are extracted using a python script.
After converting my graph from Dynamo 2.12 to Dynamo 2.16 for Revit 2023 it doesn’t work anymore. It used to work with all the older versions before 2.12 aswell.
Code of the Python Node is:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
params = UnwrapElement(IN[0])
pname = list()
pgroup = list()
ptype = list()
isinstance = list()
for param in params:
if str(param.Definition.BuiltInParameter) == "INVALID":
pname.append(param.Definition.Name)
pgroup.append(param.Definition.ParameterGroup)
ptype.append(param.Definition.ParameterType)
isinstance.append(param.IsInstance)
OUT = pname, ptype, pgroup, isinstance
I figured that the problem is, that now you can’t get the “ParameterType” the way it used to be.
Some research on the forum found that it’s a case of the new Forge/ SpecTyp stuff, so I tried to use that in the python script.
But as I’m not that good at python I simply couldn’t figure out, how to get the parameter types extracted.
Tried this instead of the “ParameterType” one:
...
ptype.append(param.Definition.GetDataType().TypeId)
...
But the “FamilyParameter.Create”-node appears to only accept the parameter types in the correct format.
Like in 2.12:
Typing them manually as a string, like in the picture above, works.
But I want the ParameterTypes to be read automatically from the parameters of the family.
I also tried to find a node in one of the may packages out there, but couldn’t find anything regarding this topic.
Does anybody know, how to get the ParameterTypes of family parameter on Dynamo 2.16+ in Python? Or a node that does that?
Thank you.