Intersecting lines without having to touch them

If you select both edges and paste the following snippet into the console (and press enter) a guide point will appear at each edge at the closest point.

es = Sketchup.active_model.selection.grep(Sketchup::Edge)
return unless es.length == 2
ray0 =  [es[0].start.position, es[0].end.position - es[0].start.position]
ray1 =  [es[1].start.position, es[1].end.position - es[1].start.position]
pts = Geom.closest_points(ray0, ray1)
return unless pts
pts.each { |pt| Sketchup.active_model.entities.add_cpoint(pt) }
1 Like