Tool Activation prevention
-
I have a plugin that i was trying to make and I do not want it to start when I have not selected a group. I thought this solution would work but it does not.
below is some part of my code . any tip would be greatly appreciated.class Testing def initialize @ip = nil @ip1 = nil @ip2 = nil @xdown = 0 @ydown = 0 @state = 0 end def activate # I was expecting it not to activate when nothing is selected at first sel = Sketchup.active_model.selection break if sel.empty? # some codes end def onMouseMove(flags, x, y, view) # some codes end end
Advertisement