Object attribute assignment

Hi there,

A noobs question about objects attributes, I intend to create a reusable component (for re-usability) that takes users’ input to assign an object before its creation with the desired attributes (I mean a lot of attributes), so:

  1. Should I list all those attributes values in a list, or is there another method that I’m missing ?

  2. If the past question was true, is there a normalised way to list them ?

  3. What is the #python script I should employ in the second component so that this object gets automatically assigned with those attributes when created ?

Thank you in advance

Just for the sakes of clarity, what do you mean with Attribute ?

Attribute in the c# / .NET sense ? https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/

Or are you talking about fields / properties of an object ?

That type of Attributes

My idea is not only I could control attributes but to be able add some more (custom made)

I believe you need to use UserDictionary

Could you give me more details ??

Each Rhino object consists of a single piece of geometry and a single attribute instance. The attributes store the object name, layer, colour, material etc.

Both the geometry and the attributes make allowance for userdata. You can store as much data you want in the user dictionary.

Do note that Grasshopper does not deal with attributes, it only cares about the geometry.

1 Like