PickHelper pick outside context

Is there a way to pick objects outside the context once you are inside a group or component?

Looks like, not really. However InputPoint can do something… :thinking:

class TestToolPH
  def activate
      @ip = Sketchup::InputPoint.new
  end

  def onMouseMove(flags, x, y, view)
    @ip.pick(view, x, y)
    ph = view.pick_helper
    ph.do_pick(x, y)
    view.tooltip = "ph:#{ph.picked_edge}\nip :#{@ip.edge}"
    view.invalidate
  end
end
Sketchup.active_model.select_tool(TestToolPH.new)

image

image

2 Likes

… and you can compare InputPoint#instance_path to Model#active_path to be sure that the pick is outside the current active edit path. (nil means that nothing is yet picked.)