Hi.,
Somebody could help or throw light on how to access the function in a ruby program to use in the Dynamic Component attribute field. ie custom function apart from the standard function available in the sketchup ( like, math, trig, Logical). Reference for the same is attached in the screenshot below.
You cannot, by default.
To call a function from the attributes, the function has to be registered to the dynamic components extension’s function handler.
Dynamic Components is a proprietary closed source extension copyrighted by Trimble.
It is not allowed for publicly published extensions to modify the Dynamic Components modules or classes.
The main reason is that modifying the DC classes set up a scenario where DC components are marked as version “1.00” (indicating they need code version “1.00”, but in reality you would have revised the DC class code to some higher version. (It is the privilege and responsibility of the code copyright owner to revise the DC code.)
It would be better and simpler if your extension code inserted a value into the target component’s “dynamic_attributes” dictionary, and then other DC attributes use that value.
For a default value, the attribute/value is inserted into the DC definition’s “dynamic_attributes” dictionary, and any individual overridden value is inserted into the DC instance’s “dynamic_attributes” dictionary. (So the former always exists, and the latter only if an instance uses a value different from the default definition value.)
Thanks @DanRathbun & @kengey.
Seems to understand a little bit
Even for a custom attribute apart from native attributes, the value cannot be called from ruby, ( i am referring the above image, which has posted earlier.
Forgive if it seems silly…