I have a little problem - I want to call every windows height and width via python (2-2, 2-3). However, I only get every windows height - the width is always 0,000m. Why is this BuiltInParameter empty?
I can call every windows width, if i transform them with elements.type into a family.element (I get a FamilySymbol Object) - but then I can not set a value to this type. - A way to transform a FamilySymbol Object back to an element would also help.
Here is my Python-Code:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
windows = []
for w in IN[0]:
windows.append(UnwrapElement(w))
# get the window height
height = []
for w in windows:
sill_height = w.get_Parameter(BuiltInParameter.WINDOW_HEIGHT)
if sill_height != None:
height.append(sill_height.AsValueString() )
# get every window width
width = []
for w in windows:
sill_height = w.get_Parameter(BuiltInParameter.WINDOW_WIDTH)
if sill_height != None:
width.append(sill_height.AsValueString() )
OUT = height, width