Own Dynamic Component supported function
-
Whith the DC function CURRENT you can access the dynamic dictionary value 'LenX' of the component:
=CURRENT("LenX")/2How can I make a similar function and access the dictionary?
class DCFunctionsV1
protected
def mycurrent(param_array)
# Question:
# WHAT CODE IS NEEDED HERE TO ACCESS THE DICTIONARY?
#
end
end -
You cannot do that, and still have a Dynamic Component that is version 1.
-
The name of the dictionary is
"dynamic_attributes"
If you have to mess the Component's dictionary, do it using:
comp.get_attribute("dynamic_attributes","keyname")
and leave the**DC**
classes alone. (They are scrambled for very good reasons, and should be considered a part of Sketchup.) -
I found it. With
@source_entity.get_attribute("dynamic_attributes", "somekey")
you can access the dictionary-values.
-
.. seems to be an echo in HERE... Here ... here ... here ... here
-
The
@source_entity
was the key. No echo!
And get_attribute should only read values and not mess the dictionary.
Advertisement