I wrote a script and it should tag mark MEP FABRICATION DUCTWORK according to its system. For example if I have system 1, all the duct work in the system should be marked 1 to n. If i have system 2, all the duct work in the system should be marked 1 to n.
Please look below to see what i have so far. The script seems to not work.
If you want to number your elements in a system, you’ll have to group elements by system first, then count the number of elements in each system. Right now you’re only counting one element so you’re only writing to one element.
You only need a few standard nodes. Use GetParameterValueByName to get the system and GroupByKey to group them. Then use Count to get the number of elements in each group. Give it a try and see what you come up with.
Thank you Nick i see what i was doing wrong. They is an issue of the output not grouping by the unique item. When I attempt to do so it only counts one element in the uniqueitem list
the levels in list.Groupbykey is @L4 but at the + operator is @L3.
2.The setparameterbyname typically i link the element to the all elements at catagory node output. the value i link to the + operator node output. My intention is for the output for the setparameterbyname node to be the same as the output of the+ operator.
It looks like your GroupByKey function isn’t using the elements. You need the list input to be the elements and the keys input to be their System Name. Then you’re elements will be grouped. Right now it looks like the System Names are being grouped instead.
Once your Elements are grouped you can use them as the input for SetParameterByName.