Problem Sequentially Populating Parameter Values of Elements

Hopefully somewhere here can help…because I am at a loss. I have list of Mechanical Equipment (162 elements) that I want a specific parameter to be sequentially numbered starting with 1 & ending with the last/total number of Mech Eqpm elements (162). As you can see in the 1st screenshot 162 elements go in & a sequence list of 1…162 (as strings) also go into the “Value” input. However they do not come out correct. In the screenshot you can see that the 2nd element is populated with the #51 (this same issue occurs randomly as several points in the list, but most populate sequentially as they should).

Additionally, the Revit schedule I am using to verify the sorting, it shows only 150 pieces of Mechanical Equipment that have a value in that parameter (this is a new parameter I had just created, so no values existing in it prior to running this script.

Any help would be much appreciated…as the last of my hair has fallen out!!!

Are these type of instances? Anything in a group?

Thanks for responding - I actually figured out the issue. The project has multiple buildings all attached & multiple phases. Earlier in the script I had filtered out unique items from lists separated by building & level - but I failed to remove the unique items at the end once I combined the remaining items from all lists (some views of building xx overlapped with building xx)

1 Like