I’am new to writing (Revit related) Python Script in Dynamo.
And i’am wondering what kind of headers (modules / libraries) are neccesary when getting data from Revit elements. I started with a Clockwork Node as a reference. And it used the following as a header:
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
(e.g. Element.ID+)
But the script also works without this header and that seems strange to me.
So is it still neccesary to add this kind of header when getting data from revit elements?
Perhaps these libraries and modules are also beeing loaded without explicitly calling them?
Or is this behavior not intended and less stable.
Just try:
items = UnwrapElement(IN[0])
elementlist = list()
for item in items:
try:
elementlist.append(item.Id.IntegerValue)
except:
elementlist.append(None)
OUT = elementlist