Unable to Collect Same Number of Elements From List


Hi guys,

I’ve been trying to figure out what went wrong with my script for extracting certain parameters (Asset Tags for all Electrical Elements in the model) It’s been giving me real headache and I can’t seem to figure out why the total number of Electrical Elements (which is 1463) does not match with the total collected elements (when I plugged in flattened list node to collect elements in room node)

My ultimate goal is pretty simple, Stage 1: I want to extract all electrical elements per room and create a spreadsheet of its parameters (i.e., element id, asset tags, family name, etc.) and for Stage 2: If there are accidental tampering in the model, I’d like to push its original parameters (extracted to a spreadsheet) back to Revit.

I understand that it might have something to do with lacing and I’ve tried experimenting different lacing per node but it does not solve my problem.

When I run the script it only gives me 259 elements in lieu of 1463. So my big question is, does it have to do something with list management or list structuring or lacing? I’m a novice user and I’m still trying to get my head around these topics. I have zero knowledge about Python or similar snake as well.

May I ask for some advice please? Apologies in advance if there’s a similar topic

Hi Rue,

Firstly, don’t use list create and then flatten. Use the List Join instead :+1:

I cannot see where the data is lost. However, whilst investigating i made a couple of observations. One, an element not within a room will be omitted from the lists. Secondly, elements must be 100% within the room. One of my elements was missing in the list, i found out it was a coat hook item that was within a wall by 2mm. Even though the element was registering within the Revit room itself :sweat_smile:

Might be something to do with the python code within the node? Pass as its a bit advance for my skill level. For starters though see if my observations are the reason for your list size mismatching.

Sorry i couldn’t be of more help.

Best,
Ben

Thanks heaps Ben. I haven’t thought of using List.Join but wow, it works!

As for your observation, spot on mate! It’s actually one of my frustrations. I know I gotta make sure those elements I’m looking for are inside a room. I even checked if Room Bounding is ticked in Revit. However, some elements doesn’t show up in the spreadsheet.

I also had the same thought. Perhaps its one of the limitations of the Collect Elements node. Maybe it can only collect a limited number of elements. In fact, the linked model I’m working on is a 3-storey building but it was only able to collect elements at ground floor and I really can’t seem to figure out which part of the graph creates the list size mismatch.

Anyway, thanks again for your input. Cheers!

@rue_santos,

Well I was getting elements and rooms from two levels.

I’m sure the task is perfectly achievable. Just might not be with this node! Don’t give up and see what you can get to work. The more you experiment and play, the more you stand to learn and gain!

Best,

Ben