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

    Posts

    Recent Best Controversial
    • RE: Rotating component

      I wrote this one a while back:
      http://www.crai.archi.fr/RubylibraryDepot/Ruby/EM/rot90.rb

      Rotates by 90 degrees around your choice of red|green|blue axes with a right click selection (can be mapped to a shortcut key). CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: Separating a plugin from others

      When you create an object from the class, you have to specify which module it should come from. This code works fine for me:

      
      module Mod1
      	class Test
      		def id
      			puts "Mod1 Test"
      		end	
      	end
      end
      
      module Mod2
      	class Test
      		def id
      			puts "Mod2 Test"
      		end
      	end
      end
      
      t1 = Mod1;;Test.new
      t2 = Mod2;;Test.new
      
      t1.id
      t2.id
      
      

      Result:

      
      Mod1 Test
      Mod2 Test
      
      

      Note that I create two objects (t1 and t2), one of each class. I get away with the classes having the same name because they live in different modules. CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: Angle = vector1.angle_between vector2

      vec1.angle_between(vec2) always returns a positive value. I struggled with this when trying to create a transform to make one object parallel with another. What I ended up doing was rotate by the angle returned by angle_between, and then checking the result to see if the objects were indeed parallel. If not, I would instead rotate by the opposite (negative) value. CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: List of International Lumber Sizes Needed

      @mics_54 said:

      Does 3/4" plywood even exist anymore?

      Just buy a sheet of 23/32, and let it get wet!

      posted in Corner Bar
      daikuD
      daiku
    • RE: Snapping to grid in two dimensions

      Sorry about bumping my own thread, but I'd really like to solve this one. The built-in rectangle tool does exactly what I want. You can see it by watching the VCB. Even though you are at a diagonal distance from the the first point, it snaps to even numbers in the cartesian directions.

      I started with the line tool sample, but I modifed the VCB code to display the x and y offset values rather than the striaght-line length. But they are always some odd value with a ~. CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: Quit Current Tool

      Thanks Tig. My tools are specific to a very specialized group of users (timber framers), so they'll know what should be selected. I think having the tool grayed out on the menu is all I need to do. CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: Quit Current Tool

      Yes, validation_proc is the correct solution for me. Don't even start the tool if we're not in the correct state. Thanks, Jim. CB.

      posted in Developers' Forum
      daikuD
      daiku
    • Quit Current Tool

      I'm creating a tool, and there are certain situations where it's inappropriate to use the tool (the user does not have the correct type of component selected). I can display an error message easily enough, but how do I then quit the tool? CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: Model.active_path uses global coordinates?

      @thomthom said:

      I think that as a component/group is opened for editing, all co-ordinates are made global.

      That explains much.

      @thomthom said:

      Su7.0 introduced a method to help on this matter: http://code.google.com/apis/sketchup/docs/ourdoc/model.html#edit_transform

      And I'll have to transform them all back myself, I guess. Thanks, Thomas.

      posted in Developers' Forum
      daikuD
      daiku
    • Model.active_path uses global coordinates?

      I want to manipulate the component definition for the component the user is currently editing (which is nested 2 layers deep). If I do this:

      ci = model.active_path.last 
      cd = ci.definition
      

      I get a valid component definition of the type I am expecting, but if I examine the geometry in the cd, all of the locations returned are in the global coordinate system - I expected them to be in the local system: relative to the origin of the component I'm editing. This is strange. Can anyone explain what's going on here?

      posted in Developers' Forum
      daikuD
      daiku
    • Snapping to grid in two dimensions

      I'm developing a tool where I'm locating a point that's offset in two directions from a starting point. I started with the example line tool, and things are working pretty well, but the snapping isn't what I would like. It snaps to the nearest 1/8", but in the 'diagonal' distance from the starting point. The x,y values I snap to are thus not multiples of 1/8". The built-in rectangle tool behaves like I want my tool to behave: it snaps to the grid in two dimensions. Does anyone know the trick for this? CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: How to pull two values from the VCB

      Clearly I was overthinking it! Thanks, Thomas.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: How do I find the face I just created with add_circle?

      I guess Martin's way is fine. It won't create a second face, will it? Yes, I'm creating it on an exisiting face. Looping through the geometry was straightforward - it's not that large a component.

      posted in Developers' Forum
      daikuD
      daiku
    • How to pull two values from the VCB

      The linetool example shows how to extract a single value from the VCB. I need to extract 2, just like the rectangle tool does, in "x,y" format. Is there an easy trick for that? CB.

      posted in Developers' Forum
      daikuD
      daiku
    • RE: How do I find the face I just created with add_circle?

      Or how about this brillaint (late) insight: I used the center point of the circle to add it, so I suppose I could now look for the face that point is on (DOH!). CB.

      posted in Developers' Forum
      daikuD
      daiku
    • How do I find the face I just created with add_circle?

      I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?

      posted in Developers' Forum
      daikuD
      daiku
    • Guide Lines disappear

      I'm noticing that when I orbit to a new position, a guide line may disappear. If I change my orientation slightly, it will come back. Very annoying, since I'm trying to construct geometry using these lines. This is new in version 7.1. CB.

      posted in SketchUp Bug Reporting sketchup
      daikuD
      daiku
    • RE: 7.1 Intersection Inference

      This one is killing me! Can someone tell me how to back down from 7.1 to 7.0? CB.

      posted in SketchUp Bug Reporting
      daikuD
      daiku
    • RE: Ruby MySQL module in Sketchup

      Hi Pauline.

      If I understand correctly, your problem is executing a "require" command from the console window? If so, here are 2 things to keep in mind:

      • Specify the full path (note how in my example, the first fails, but the second works)
      • Use the '/' character, not '' for the separator.

      @unknownuser said:

      require 'reglue.rb'
      false
      require 'C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/reglue.rb'
      true

      posted in Developers' Forum
      daikuD
      daiku
    • RE: [Request] Reglue

      I wrote a script called reglue.rb that you can find at the ruby library depot. It's specific to my own needs, but perhaps you can adapt it to yours. In my case, the object you are gluing to is the parent of the component being reglued.

      posted in Plugins
      daikuD
      daiku
    • 1 / 1