Get and change dynamic attribute

Please code correctly in the forum so we don’t get the " replaced with smart-quotes.

It is the C API. (The old C++ API was retired several years ago.)

For your info, the C API cannot be used to modify the model file that is currently open in the SketchUp application. (You can use it to open other SKP files on disk.)

SUEntitiesGetInstances gets an array of instances, not a single instance.
You will need to first call SUEntitiesGetNumInstances so you can set the size of the array.

The C API has dedicated interfaces to query the dynamic dictionary of an instance (or it’s definition.)


I do not see this function in the API. Is it one of your custom functions ?

If so, you need to understand that with only 1 dynamic instance in the model, the dynamic attributes will be held in the definition’s dynamic dictionary. (The instance will have a dynamic dictionary but will usually only contain a bare minimum of hidden informational attributes.)

The attributes in the definition will be the default values. When there are more than 1 instance and an instance differs from the default, the DC extension will create a dynamic attribute in the instance’s dynamic dictionary and also change the same attribute in the definition’s dynamic dictionary so as to update the default to be used by the next instance that the user may create.