Well I guess I will have to get off my butt and post the answer to my own question:
# clear everything out Sketchup.active_model.entities.clear! # add the parent group group1 = Sketchup.active_model.entities.add_group # set parent’s transformation group1.transformation = Geom;;Transformation.translation(Geom;;Point3d.new(10.m, 0, 0)) # add some points to the parent group group1.entities.add_cpoint(Geom;;Point3d.new(0.m, 0.m, 0.m)) group1.entities.add_cpoint(Geom;;Point3d.new(5.m, 5.m, 3.m)) # add the child group group2 = group1.entities.add_group # set child’s transformation group2.transformation = Geom;;Transformation.translation(Geom;;Point3d.new(0, 10.m, 0)) # add some points to the child group group2.entities.add_cpoint(Geom;;Point3d.new(0.m, 0.m, 0.m)) group2.entities.add_cpoint(Geom;;Point3d.new(5.m, 5.m, 3.m)) # group transformations are now correct puts Sketchup.active_model.active_path puts group1.transformation.to_a.join(', ') puts group2.transformation.to_a.join(', ') puts Sketchup.active_model.edit_transform.to_a.join(', ') # from top level active_path = nil group1.transformation = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 393.700787401575, 0.0, 0.0, 1.0] group2.transformation = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 393.700787401575, 0.0, 1.0] edit_transform = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0] # open group1 active_path = [group1] group1.transformation = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0] group2.transformation = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 393.700787401575, 393.700787401575, 0.0, 1.0] edit_transform = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 393.700787401575, 0.0, 0.0, 1.0] # open group2 active_path = [group1, group2] group1.transformation = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0] group2.transformation = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0] edit_transform = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 393.700787401575, 393.700787401575, 0.0, 1.0]Advertisement