Need Help adding predefined dynamic Attributes via Ruby
-
Hello To all !!
I am trying to create a useful Plugin for creating a simple Box
in Ruby via User Input, then storing the Input Informations to the "dynamic_attributes"
Dictionary.As a starting-Point I took the Box.rb from the Examples-Plugin and extended it
a little.So far everything worked beautifully, since there are Heaps of Example-Code
for this type of task and any Custom Attribute (info) that I store seems to be showing too.However,what I would like to do now is to manually add the LenX, LenY and LenZ Attributes
to the Component (with Ruby) without setting a fixed Value aka "=Value" so that I can benefit from all the nifty observers that take care of auto-updating the corresponding Values thru a change.That would be very helpful since I dont want to use the right click menu all the time
to add LenX, LenY and LenZ to every Part that is needed and I could also continue
to use FredoScale (one of my favs in everyday use) and at the same time get accurate results in the Report.Sadly I didnt find any Very useful Code that explains how to handle the Formulas
that are used to store the actual Value of the coresponding Attributes inside the DC.
(besides the custom ones where a few snippets can be found (Sangs Color from Scott Lininger)).Any Help would be very appreciated since I am starting to get crazy over this.
PS: I Apologise for my Bad English and I am Hoping anyone can help
-
Download some Dynamic components from the 3D Warehouse and inspect their "dynamic_attributes" dictionaries.
-
... using:
http://extensions.sketchup.com/en/content/attribute-inspectorAnd see this wiki thread in the official forums:
-
Thank You very mouch for the Info,
I didnt know that there is a plugin that shows the normally hidden
Attributes.Very useful, I guess I got some homework to do now
-
Allright, Got it partly working,
But I Cant get the Attribute-Inspectors to show the
Values, I guess I dont really understand how
to set the Formulas correctly to get the corresponding Values by now.The DC Browser shows the Values (Lengths of the Piece in X,Y and Z)
but everything else does not, this means no reporting so far.Can anybody push me a little in the right Direction
Where do I have to set the DC Attributes Instance or Definition?
and how could I set it to both if needed?I tried to set it to the Definition and the second time I run the Script
the created Geometry has no Attributes at all, or at least nothing
important.
Advertisement