I’m making another attempt at creating a tool to mimic the place component tool. The problem I’m having is that when moving my opening around it gets in the way so it is between the face and the cursor. I tried hiding the door during the pick, but it still inferences to the door causing a bunch of jumping around and resulting in zero faces being picked. The place component tool works smoothly in comparison.
Here is the code in the onMouseMove method of my tool where I try to select the face.
def onMouseMove(flags, x, y, view) @inst.hidden = true view.pick_helper.do_pick(x, y) puts view.pick_helper.all_picked.grep(Sketchup::Face).count.to_s + ' faces picked.' @face = view.pick_helper.picked_face @inst.hidden = false if picked_first_point? @mouse_ip.pick(view, x, y, @picked_first_ip) else @mouse_ip.pick(view, x, y) end view.tooltip = @mouse_ip.tooltip if @mouse_ip.valid? view.invalidate end
Here you can see how it is inferencing the door.