Copying User Attributes

Hello,
this is my first ever dynamo project, I wanted to make a script that finds main part of an object and copies it’s user attribute and sets it to all objects that are connected to the main part. Right now I managed to make a script that checks if the element is a main object or an attached one and generates list of attatched objects and a list of main object’s user attributes. I would like to assign the same user attribute to all connected parts to that certain main object but right now it just copies those user attributes in the same order as listed to the list of connected parts. Is there any way to fix this?

Welcome to the forum.
I changed the category to Advanved Steel instead of Civil 3D due it Isn’t related to civil.

1 Like

Hi @SytheOne

this would be a valuable, time-saving script.

I guess you can assign mainpartnumbers and then match the elements by looking up this criteria.

But that is allready a bit of a reacharound.

In Revit you can get Element.SubComponents for nested Families.

This relation should be available in Advance Steel too, no?

Hi @SytheOne

there is a way to address the adherence to a main part.

But apparently, “Attributes” and “build in Properties” such as Mainpart Number are treated differently.

As you see in the lower flow, you have to make the property a string first, chop some of the copy, and then it can serve as a Key which allows you to group all ASteelObjects by Mainpartnumber.

Kind regards,

Willem