I’m having some issues in Dynamo. I’m trying to create a script, that recognizes if any of the categories “Areas”, “Rooms” or “Spaces” are present in the model. In my current Revit model, only the category “Rooms” are present. The idea was to use == to check if the list of categories in the model, matches any of the specified categories, but the node returns “false”. Any idea how to solve this?
Are you looking to check if there’s any elements present of those categories? If this is the case, then you need an All elements of category node in there as well.
You will also likely need some cross product lacing on your ==, since you want to check all items from the two lists between each other.
Edit: Another good advice: share a dummy Revit/Dyn file. Will make it much faster to get help
Thanks for your answer. I have tried to lace to Object.Identity before the == node. However, it seems to just give me the same output as list.flatten, so I’m not quite sure what to conclude based on that.
I am actually just looking to check if the category is present (at the moment at least ).
I am not quite sure what you mean by cross product lacing. I took a look on the list.CartesianProduct, but I dont understand how this node could help compare the two lists (if this was that node you were talking about).
I am a new user, so unfortunatetly I cant attach .dyn files
These categories will only be active in the document, if there’s any elements present, so why not just check for elements? If the end goal is to check if the category it present, then I think you are overcomplicating this by diving into the cross check:
After this you can extract the trues from the nested lists.
I hope this makes sense. This is something that is also explaned pretty thoroughly in the Dynamo Primer, so if you haven’t read it already, I’d advice you go plow through it