btw, to esily detect if a ComponentDefinition is open for editing you can do this test
def inside_component?(definition)
path = (Sketchup.active_model.active_path || [])# This method should in my view return an empty Array, not nil, when the model root is the active context.
instance = path.last
instance && instance.definition == definition
end
With regard to the others, I think they’ve been asked for. It is hard for us because we cannot get the nesting path unless the object is open for edit, and we cannot cause the object to be opened for edit.
There is a “feature” of Attributes where a Point3D stored in a Dictionary is updated when the Instance is moved. Could this be exploited to store the model transformation of the Instance? (I am unable to test this now)
You may not have noticed, but the Dynamic Components extension defines a couple of global hashes, that store transforms (with object_id as key I think, or perhaps just object reference,) as the user clicks down into instance nesting.
Yes that I know. Anyway since my last topics I have started to shift my mind towards how SU is actually operating, and realizing its a pretty pure MV pattern, now I know how to handle its data and my needs for realtime sync with an external app :), thanks for all the hints.