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_entitywas the key. No echo!
And get_attribute should only read values and not mess the dictionary.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement