Find the size and coordinates of the group

Bookmark these lists:

It is not my responsibility to do your work for you. We encourage new coders to at least make an attempt to solve their own coding challenges, and ask specific coding questions here in the forum, so that they can succeed themselves. It is the best way to learn.

I gave you a partial answer above for the coordinates of the “Group A” origin.

Group B’s bounds center will be within the entities of Group A and the coordinates will be relative to Group A’s transformation. If the center of the circle is also the origin of Group B, then this will be simpler as it will also be the origin of B’s transformation.


I showed above how to find a group by instance name. If you wish to find a group by layer name, then …

group_b = group_a.entities.grep(Sketchup::Group).find { |grp|
  grp.layer.name == "Layer 1"
}
2 Likes