You didn’t share your model, but apparently grp0 was created that way, where its axes and origin are the same (coincide) with the global axes and global origin.
So @mike09 why would you not expect grp0 to have an identity transform when you are in another edit context?
Read the API Note in the Model#active_path= setter method regarding the change in coordinate system whenever the user (or the API) has drilled down away from the top model entities context.
It is very important to understand that this edit mode change into model coordinates affects all API methods accepting or returning coordinates, scaling or lengths, etc.
However, if the active entities is still the top level model entities, and you are inspecting the groups entities members then the definition’s local coordinates will apply.
Thank you, Dan, your answers are always helpful. Maybe you’re right and I didn’t make it clear enough what confused me.
In my mind, transformation is a description (position, direction and scaling) of local coordinates space in which entities, included in group (component definition) are lying. Agree that to determine these properties (position and so on) we must have a point of reference - a kind of global (root) coordinate space. This code (and documentation)
confirms that it is not constant (and that’s not a problem). Perhaps I am mistaken, that is indicated by rgb axes and returned by Model#edit_transform. In case active_path.empty? it equal to model coordinates space, in edit mode - to editing groups (instance) transformation. It seemed strange to me that two clearly mismatched groups both have same (IDENTITY) transformation at same time.
I think this handling of coordinates within the active context derives from what happens in the GUI when you open a group or component instance for edit: you see and interact with it through the view window, which always shows model coordinates. Otherwise you couldn’t snap to inferences from anything outside the context. I think the devs put a thin wrapper around this for the Ruby API, assuming that coders would figure it out.