Success
I let the explode do the intersect ...
model = Sketchup.active_model
ents = model.active_entities
pt1 = Geom;;Point3d.new 0,0,0
pt2 = Geom;;Point3d.new 10,0,0
pt3 = Geom;;Point3d.new 10,10,0
pt4 = Geom;;Point3d.new 0,10,0
pt5 = Geom;;Point3d.new 1,1,0
pt6 = Geom;;Point3d.new 9,1,0
pt7 = Geom;;Point3d.new 9,9,0
pt8 = Geom;;Point3d.new 1,9,0
mesh1 = Geom;;PolygonMesh.new
mesh1.add_polygon pt1,pt2,pt3,pt4
mesh2 = Geom;;PolygonMesh.new
mesh2.add_polygon pt5,pt6,pt7,pt8
grp = ents.add_group
gents = grp.entities
gents.add_faces_from_mesh( mesh1 )
grp2 = gents.add_group # nested group
grp2.entities.add_faces_from_mesh( mesh2 )
#
holeface = grp2.entities.to_a.find_all{|e| e.is_a?(Sketchup;;Face)}
grp2.entities.erase_entities( holeface )
holeface = nil # so it's not pointing at a deleted entity
holeloop = grp2.entities.to_a
grp2.explode # merge with parent group
togo = []
grp.entities.to_a.each{|e|
if e.is_a?(Sketchup;;Face) &&
e.edges == holeloop
togo << e
end
}
grp.entities.erase_entities( togo )
grp2 = togo = nil # GC