src/jwm_draw_framing/draw_framing_main.rb
#def onMouseMove
#-------------------------------
# The onLButtonDOwn method is called when the user presses the left mouse button.
def onMouseMove
The onLButtonDOwn method is called when the user presses the left mouse button.
def onMouseMove The onLButtonDOwn method is called when the user presses the left mouse button .
def onLButtonDown(flags, x, y, view)
		if( @state == 0 )
			@ip1.pick view, x, y
				if( @ip1.valid? )
          if @ip.face
            f = @ip.face
            if f.normal == X_AXIS || f.normal == X_AXIS.reverse
            @@axis_lock= X_AXIS
            end
            if f.normal == Y_AXIS || f.normal == Y_AXIS.reverse
            @@axis_lock= Y_AXIS
            end
            if f.normal == Z_AXIS || f.normal == Z_AXIS.reverse
            @@axis_lock= Z_AXIS
            end
          end
						@tf = @ip1.transformation
						@state = 1
						txt = "Select plane of cross section using cursor (arrow) keys - red = Right, green = Left, blue = up or down "
						Sketchup::set_status_text(txt, SB_PROMPT)
				else
					Sketchup::set_status_text(txt, SB_PROMPT)
					@xdown = x
					@ydown = y
				end
		else @state = 1
			if( @ip2.valid? )
				self.create_geometry(@ip1.position, @ip2.position, view)
				self.reset(view)
			end
		end
		view.lock_inference
	end
def onLButtonDown ( flags , x , y , view ) if ( @state == 0 ) @ip1 . pick view , x , y if ( @ip1 . valid? ) if @ip . face f = @ip . face if f . normal == X_AXIS || f . normal == X_AXIS . reverse @@axis_lock = X_AXIS end if f . normal == Y_AXIS || f . normal == Y_AXIS . reverse @@axis_lock = Y_AXIS end if f . normal == Z_AXIS || f . normal == Z_AXIS . reverse @@axis_lock = Z_AXIS end end @tf = @ip1 . transformation @state = 1 txt = "Select plane of cross section using cursor (arrow) keys - red = Right, green = Left, blue = up or down " Sketchup :: set_status_text ( txt , SB_PROMPT ) else Sketchup :: set_status_text ( txt , SB_PROMPT ) @xdown = x @ydown = y end else @state = 1 if ( @ip2 . valid? ) self . create_geometry ( @ip1 . position , @ip2 . position , view ) self . reset ( view ) end end view . lock_inference end
def onMouseMove
The onLButtonDOwn method is called when the user presses the left mouse button.
def onMouseMove The onLButtonDOwn method is called when the user presses the left mouse button .
# When the user clicks the first time, we switch to getting the # second point.	When they click a second time we show the planned cross-section ## Detect if pick point is on a face, and if so, orient long axis normal to it #UI.messagebox  # puts"Face picked: normal is " + f.normal.inspect.to_s # puts@@axis_lock.inspect.to_s # puts@@axis_lock.inspect.to_s # puts@@axis_lock.inspect.to_s # call the transformation method to get the component/group instance Transformation vector # if @opts['mode']==1#@draw_cpoints # txt << "off." # else # txt << "on." # end # txt << "on." # txt << "TAB = stipple." # create the cross-section on the second click # Clear any inference lock
flags
<not_specific>
x
<not_specific>
y
<not_specific>
view
<not_specific>