sketchucation logo sketchucation
    • Login
    1. Home
    2. Casey
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    C
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 5
    • Groups 1

    Posts

    Recent Best Controversial
    • UI Inspector

      Hello, Does anyone else have this problem or am I doin something daft?

      When I open the UI Inspector to set options for joints quite often nothing shows up in the UI. This can be solved mostly by opening and closing the skp file a few times but dosent always work, sometimes the skp file has to be scrapped.

      Not a big problem atm as I am only messing about with physics atm, but if I have a larger model the needs to be deleted will be a different story lol.

      Hopefully Its something I am doing wrong.


      UI.PNG

      posted in SketchyPhysics
      C
      Casey
    • RE: Component definition name

      Works great, thanks.

      posted in Developers' Forum
      C
      Casey
    • Component definition name

      Hi,

      How to get the definition name from a selected component?
      I tried the code below, assuming only one component selected which is correct. But this returns just the name not the definition name which is set when the component is created.

      
      model = Sketchup.active_model; 
      selection = model.selection
      
      componentdef = selection[0]
      UI.messagebox(componentdef.name)
      
      
      posted in Developers' Forum
      C
      Casey
    • Linetool.rb snap

      I have been messing with the linetool.rb example and copy parts into my tool class, which is the code in the linetool.rb that makes the coloured dots appear over vertices before you click? I assume its in the mousemove function but I tried replicating it to no avail.
      Sorry if its a dumb question but its hard to find much info about and the google docs can seem a bit vague.

      posted in Developers' Forum
      C
      Casey
    • Inpupoint pick problem

      Hi,

      I am trying to make a simple tool, which starts by drawing a line. I looked in the linetool.rb file to see how that works, but theres a lot going on in there!!!

      Anyway below is my tool which just has a couple of variables to store some pick points, trouble im have is i get an "undefined method pick" in the console. Do I need to include some other file? there is nothing else ncluded in linetool.rb. Any help appreciated.

      
      require 'sketchup.rb'
      
      UI.menu("Tool").add_item("my tool") {
      Sketchup.send_action "showRubyPanel;"
      Sketchup.active_model.select_tool(My_Tool.new)
      }
      
      class My_Tool
      
      	@ip1 = Sketchup;;InputPoint.new
      	@ip2 = Sketchup;;InputPoint.new
      	@point_flag = 1
      
      	def activate
      		puts "Activate"
      	end
      
      	def deactivate(view)
      		puts "Deactivate"
      	end
      
      	def onMouseMove(flags, x, y, view)
      		puts "Mouse Moved"
      	end
      
      	def onLButtonDown(flags, x, y, view)
      		puts "Lbutton Down"
      	end
      
      	def onLButtonUp(flags, x, y, view)
      	    if(@point_flag)
      			@ip1.pick view, x, y
      			@tool_flag = 0
      		else
      			@ip2.pick view, x, y
      			@tool_flag = 1
      		end
      	end
      
      end #end of class My_Tool
      
      
      posted in Developers' Forum
      C
      Casey
    • 1 / 1