Filter the parameters in family by length type of parameter

Hi, I am using orchid node to get all the parameters from currently opened family file. i would like to select all the length type parameters. can anyone please tell me know to do it? Thanks.

@dylanpeng you are passing strings. You need to pass the actual parameter

@salvatoredragotta could you please show me how to do it?

@dylanpeng Use the following code to get the storage type and then just filter

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
mgr = doc.FamilyManager

name=[param.Definition.Name for param in mgr.Parameters]
storage=[param.StorageType for param in mgr.Parameters]

OUT = name , storage

@salvatoredragotta thanks a lot. Is it possible to separate by the type of parameter as I highlight below?
may I ask what is the API code for Length ?

image

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

mgr = doc.FamilyManager

Type=IN[0]

TypeParam= [param for param in mgr.Parameters if param.Definition.ParameterType.ToString()==Type and param.IsInstance==False] 

TypeParamName = [param.Definition.Name for param in TypeParam]



OUT =  TypeParam, TypeParamName 

@dylanpeng

1 Like

all good, thanks!

1 Like