I generate groups for my imported autocad-components to restore a hierachy.
Now I would like to show some info in the 'Components Options' window when group is clicked.
First I follow TIG's hint and add a definition to the group:
class Sketchup;;Group
def definition
return self.entities[0].parent
end
end
Then I do:
### Creating of the group from array
group = entities.add_group(@group_list)
### Try to store attribut in group
group_def = group.definition
group_def.set_attribute 'dynamic_attributes', '_hasbehaviors', '1.0'
group_def.set_attribute 'dynamic_attributes', '01_dummy', 'Dummy'
group_def.set_attribute 'dynamic_attributes', '_01_dummy_label', '01_dummy'
group_def.set_attribute 'dynamic_attributes', '_01_dummy_formlabel', 'This is a dummy attribute'
group_def.set_attribute 'dynamic_attributes', '_01_dummy_units', 'STRING'
group_def.set_attribute 'dynamic_attributes', '_01_dummy_access', 'VIEW'
group_def.set_attribute 'dynamic_attributes', 'name', 'MyName'
group_def.set_attribute 'dynamic_attributes', 'description', 'MyDescription'
group_def.set_attribute 'dynamic_attributes', 'dialogwidth', '460'
group_def.set_attribute 'dynamic_attributes', 'dialogheight', '550'
The attribute gets stored in the dictionary, but opening the 'Components Options' window show only the default window with group.name and 'There are no options to choose on this component.'
Maybe it is hardcoded that group can not have DC attributes?