YES
BTW, the group in the “cube.skp” has only the following DC attributes in the “dynamic_attributes” dictionary.
You may not know, but the Dynamic Components dictionaries are not in any way different from the dictionaries that any other extension author creates, except that they are an “native” extension that is included with SketchUp.
You can access the "dynamic_attributes"
dictionaries using the plain class functions …
An AttributeDictionary
can be attached to ANY Entity
subclass object. You’d upcast the subclass object ref to an Entity
:
SUEntityRef entity_ref = SUGroupToEntity(group_ref);
SUAttributeDictionaryRef dict_ref = SU_INVALID;
res = SUEntityGetAttributeDictionary(entity_ref, "dynamic_attributes", &dict_ref);
if (res != SU_ERROR_NULL_POINTER_OUTPUT) {
// dict_ref will be valid
SUTypedValueRef val_x = SU_INVALID;
vc_res = SUTypedValueCreate(&val_x);
if (vc_res == SU_ERROR_NONE) {
SUAttributeDictionaryGetValue(dict_ref, "x", &val_x);
SUTypedValueType tvt;
SUTypedValueGetType(val_x, &tvt);
if (tvt == SUTypedValueType_Float || tvt == SUTypedValueType_Double ) {
// Do something with the X value ...
}
SUTypedValueRelease(&val_x);
}
}
A good Attribute Inspector extension can read and display any attribute dictionary from any extension, attached to any entity objects. The model itself, any of it’s collections, it’s definitions, or drawing entities.
However the are only reader / editors. They don’t make components dynamic. Only the native DC extension does this (using attribute dictionaries named "dynamic_attributes"
.)