Hi, I would like to add custom attribute to objects on canvas and wonder if it is possible to do so.
So far, I have only tested below script by adding 1 panel component on the canvas except the custom component.
GH_DocumentIO docIO = new GH_DocumentIO(this.OnPingDocument());
foreach (IGH_DocumentObject obj in this.OnPingDocument().Objects)
{
//for all objects except this custom component
if (obj.InstanceGuid != this.InstanceGuid)
{
obj.Attributes = (Grasshopper.Kernel.IGH_Attributes) "customAttributes"; // doesn't work because string cannot be converted
}
}
Printing obj.Attributes resulted in Grasshopper.Kernel.Special.GH_PanelAttributes. Should I use CreateAttributes() ? But I wonder if this is not the correct Object Properties to attach custom data/attributes.
Thank you