Ruby scripted Dynamic Attributes reporting Issues
-
Hello to Everyone,
In 2016 I began to script a little tool to create some Dynamic Components,
with added Information, for Edgebanding and different Materials,
In the first Iteration I just made a cube, which was then changed thru the
DC Component options to the needed Size, that worked as expected.Recently I took a look at the Code and changed it, that the drawn Cube has the
right Size, as the User has to put them in an Inputbox-Prompt,
The Components are created using the Point-Method and then Pushpulled (in Ruby).However, I dont get it why I cannot get the lenx, leny and leny to report in any
Ruby- driven Report-Script I tried, until some User-Interaction with the
Component-Options has been made,
(just clicking in the Inputbox of the DC-Settings-Dialog and applying the already correct Values)
since the Original Report-Feature can report these Values without this User-Interaction.As far as I can see, the Variables are correctly set, since the DCs are working
as they should besides the Reporting-Thing.attached is a drawing with some of the scripted Components
Has anyone a clue how I can make them readable to a script?
Thank you in advance!
-
@jh said:
... I dont get it why I cannot get the lenx, leny and leny to report in any
Ruby- driven Report-Script I tried, until some User-Interaction with the
Component-Options has been made, ...The default values are stored in the DC definition's "dynamic_attributes" dictionary and the DC instance just uses the defaults until the user changes them. When they are different than the default, the DC code will create instance specific attributes in the instance's "dynamic_attributes" dictionary.
So the "rule of thumb" for Ruby coding DCs is to always first check the instance's "dynamic_attributes" dictionary, then check the definition's "dynamic_attributes" dictionary for dynamic attribute values.
Advertisement