Revit Family Parameters Value "Family Editor"

My bad @Raul.Galdran , when the parameter type is not right for the query method, I thought it would return an exception but it just returns “None”…
So here’s an alternative to make sure all parameter types are handeled :

import clr

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

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


doc = DocumentManager.Instance.CurrentDBDocument

s = doc.FamilyManager.CurrentType

pl = doc.FamilyManager.Parameters

Name_Parameter = IN[0]

p = [i for i in pl if i.Definition.Name == Name_Parameter][0]
UIunits = p.DisplayUnitType
vals = s.AsString(p), UnitUtils.ConvertFromInternalUnits(s.AsDouble(p),UIunits), s.AsInteger(p)
v = [v for v in vals if v != None]

OUT = v

I also added some code to get the current UI units in your family document and do the convetion automatically. That way all units will be handeled automatically.

1 Like