SET() Error message - Invalid entity to animate

I am trying to change dynamic component properties through ruby ​​script. But an error occurs ( Invalild entity to animate ).
The syntax is as follows
nn = “component#7”
sang_def.set_attribute ‘dynamic_attributes’, ‘onclick’, “SET(”#{nn}!Hidden",0);"

I’m using SketchUp 2021 version and I’m running Windows 10.


Most probably because the syntax is wrong. ( you are using wrong characters of double quotes " and not using or missing single quotes '… not proper usage of String literal etc. )

You can check e.g. the following topics regarding " Dynamic Components is a proprietary , closed-source native extension…" :

1 Like

The onclick formulas probably need to be defined in the Parent component for it to work properly.

thank you for reply.

I pasted the source code, but it looks strange in html.
The real code is below.


If I put the script directly, it works fine. If I just put it using ruby ​​script, I get an error.