I am struggling with something that should be simple… but has become a major inconvenience.
I need to read the level in which there is a wide range of categories (as seen below/ attached) but as there are many parameters responsible for the “level” I get a lot of errors.
I have tried to cast the parameters with if/elif/ else (as shown above) and with try/except. Besides being confusing I keep getting lots of nulls that, in Revit, are indeed signed at some level.
Has anyone dealt with this?
I need to use builtin parameters to ensure language-independent reading in Revit.
It is not a trivial task despite its apparent simplicity.
Use the Element Level node of the Genius Loci package.
It should work with all the categories/families that have a level.
I was still having many elements without the right level but when I divided them into nested and SuperComponents I realized it was not reading the level only for nested ones.
To filter nested x SuperComponents use the code below:
INPUTS
elements = UnwrapElement(IN[0])
CODE STARTS HERE
SUPERCOMPONENTS x SUBCOMPONENTS
super_comp, nested = ,
for e in elements:
if e.SuperComponent == None:
super_comp.append(e)
##### INPUTS #####
#Preparing input from dynamo to revit
elements = UnwrapElement(IN[0])
#### CODE STARTS HERE ###
#### GET #####
super_comp, nested = [], []
for e in elements:
if e.SuperComponent == None:
super_comp.append(e)
else:
nested.append(e)
OUT = super_comp, nested