Turn component into non-editable DC
-
My Autocad-blocks have an extensive set of EED-based attributes stored at the block-instance.
On Export/Import in SU they gets lost and I ended with a simple component without any info/logik.
But it would be no problem to setup a parallel info-file with autolisp to transport this information. The blockname would be the reference key.So is it possible to turn a component into a DC with ruby?
In the first step it would be nice when I could set up the attributs in a non-editable way.
So a user could use the 'Component options' button and click on my component and the Component options web dialog would open and show the stored attribute and non-editable values (greyed-out).
That would allow to import additional info about this component, without the need of a full blown DC-Logik behind it.Ot cource adding Interaction-logik to use with the interact tool will be the next wish.
Other threads here in the forum mainly do reading attributes or set existing attributes.
So whats the real difference in the SU-database between a component and a DC ?
The existence of the attributes? Any flags?Regards
Hans-Peter
-
The sample 'Make Sang Red' from here:
might help:
# Add a new configurable option to Sang. # (Any attribute that starts with an underscore # is a "meta attribute" that describes behavior.) sang_def.set_attribute 'dynamic_attributes', 'weight', '145' sang_def.set_attribute 'dynamic_attributes', '_weight_label', 'weight' sang_def.set_attribute 'dynamic_attributes', '_weight_formlabel', 'My Weight' sang_def.set_attribute 'dynamic_attributes', '_weight_units', 'STRING' sang_def.set_attribute 'dynamic_attributes', '_weight_access', 'TEXTBOX'
Not sure if this would enough to make a normal component into a DC!
Will try.
Advertisement