class PickTool
def activate
@move_pt = @p1 = nil
end
def onLButtonDown(flags, x, y, view)
@p1 = Geom::Point3d.new(x, y, 0)
end
def onLButtonUp(flags, x, y, view)
ph = view.pick_helper
ph.window_pick(@p1, Geom::Point3d.new(x, y, 0), Sketchup::PickHelper::PICK_CROSSING)
puts ph.all_picked.to_s
end
end
Sketchup.active_model.select_tool(PickTool.new)
The entities of picked is under model.entities, not model.active_entities.
I should get faces and edges.