Is there an operation similar to List.IsEmpty for nested lists/sub-lists?
Ultimately, I’m trying to filter all the floors in a structural model to only select the ones made of concrete (either slab on grade or slab on metal deck), and assign them a new parameter value for streamlined quantification/sorting. I’d like to upload my current logic, but am getting an error saying “New users can not upload attachments”, so I guess I’ll describe it as best I can:
- Select all the floors using Categories >All Elements of Category. This returns a simple list of all the floors in the project.
- Find the materials of all floors using Element.GetMaterials>Element.GetParameterValueByName (input string “Name”). This outputs nested lists due to the fact that some floors are made up of two materials - concrete and metal deck.
- Filter out the floors that do not have concrete as a material by putting that nested list output into the String Contains function, with the searchFor input “Concrete”. Use that boolean output and the list of materials from the previous step as inputs for List.FilterByBoolMask. This returns a list of lists, each one consisting of either the concrete material of the floor, or an Empty List if there was no concrete material.
At this point I’d like to use the List.IsEmpty function to create a boolean list that I can use to filter down the original list of floors we got in step 1. However, List.IsEmpty only looks at the top level of the list and returns one output, as opposed to looking at each sub-list to give me a list of true/false values.
I’m sure this would be much easier to understand if you could actually see my file; I’ll see if it will let me upload it in the comments, since it won’t let me upload it here. Let me know if you have any questions, or if you know of an easier way to sort/filter by materials.
Thanks in advance!