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

    Posts

    Recent Best Controversial
    • RE: (Wanted) Component Plugin

      You could try cutlist its main use is for woodworking but it reports the size of all selected components.

      Keith

      posted in Plugins
      K
      ktkoh
    • RE: Router Drawing

      Thanks for the router drawing that was just what I was looking for. I will post the model again when more details are complete.

      Keith

      posted in Woodworking
      K
      ktkoh
    • Router Drawing

      Has anyone drawn a SU plunge router that they would share with me?

      I am working on a horizontal router table for making mortise cuts and would like to include a router in the drawing. I am not looking for a lot of detail just enough that it looks like a router.

      This is what I have drawn so far. You can see the basic concept but there are lots of details to work out and add. I may work out the details during the building process.

      Keith


      X-Y TableNew.skp

      posted in Woodworking
      K
      ktkoh
    • RE: Board Plugin

      Dave how do you set flip as a shortcut I didn't see it on the drop down when setting short cuts.

      Keith

      posted in Woodworking
      K
      ktkoh
    • Solid Tools

      A question for Dave or others that have tried ver8. Have you used the Boolean tools rb that is available and if so how does it compare to the native tools in ver8? As this is only a hobby I can't see the expense of su pro however I do miss the tools that my previous cad program had for solid add and subtract.

      Keith

      posted in Woodworking
      K
      ktkoh
    • RE: Board Plugin

      I do leave layer0 as active all the time I just am changing the visibality to other layers. I don't a lot in sketchup as I only draw what I am going to build with the possible exception of some shop fixtures I have not actually completed. This is the desk I am currently working on and should start it in a couple of weeks. I am quite sure my methods are not the quickest but they are consistant and work for me. I changed from scale -1 to flip because I always seemed to have placed the object such that I needed to move after scale -1

      Keith


      L shaped desk in planing stage

      posted in Woodworking
      K
      ktkoh
    • RE: Board Plugin

      That was how I had worked in the previous CAD pgm. I would use my New Part and would enter length,width,thickness and name and get a component drawn at 0,0,0 on the layer I wanted it and already named. What I also liked was that I then knew the local axis of the part and flip was easy and placing texture also consistant. Using the key rotate plugin made rotating and placing in place fairly simple. However the Board plugin convinced me to try in place modeling again and except for the local axis I liked it. I am still working on my methods but basicly my steps are.

      1. Press B Shortcut assigned to Board.rb (depends on part some are easier by lines and pushpull)
      2. Draw the rectangle and pull to fit
      3. Check and change axis (red with grain, green cross grain)
      4. Use plugin to rename and move to layer
      5. To add detail to new part I would selece scene Layer0 and make part layer visible (I always have the layer box open) and edit part

      This seems to work well for me.

      Keith

      posted in Woodworking
      K
      ktkoh
    • Board Plugin

      I have used the board plugin and really liked it. I have to date resisted drawing parts (boards) in place and used a newpart.rb that I modified from the box.rb sample. However the board plugin changed the way I now model and for the better. I wrote 2 plugins that work with the board plugin and extend its usefullness (in my opinion). The plugin "BoardToLayer.rb lets you rename the board compnent (or accept the existing name) and place it on a new layer of the same or user entered name then make the layer visible in a scene named "Assembly". If the scene does not exist the program will create it the first time it runs. You access the plugin with a right click on a component and select "Board/Comp to New Layer" from the drop down.

      The other plugin BoardToLayerK2.rb is simular except it uses layer names with my format of "A00-" prefix in front of the component name (A for assembly, 01 to 99 a layer number to keep layers in order of when they were made). There is no option in this version for the user to alter the layer name or format.

      KeithBoardToLayerK2.rb


      BoardToLayer.rb

      posted in Woodworking
      K
      ktkoh
    • RE: UI message box results

      Thanks that was a lot clearer than the docs.

      Keith

      posted in Plugins
      K
      ktkoh
    • UI message box results

      Simple question but I cant find how to retreive the results from a message box.

      UI.messagebox "Yes - Use Exiting Layer; No - Change Layer name", MB_YESNO
      

      I have tried several ways but no sucess. Documentation is very vague for this process!!

      Keith

      posted in Plugins
      K
      ktkoh
    • RE: Question about pages

      I found the solution to the page name question.

      # Add page named Assembly if not already added
            pagename=[]
            pgAssy = "no"
      	    pages.each {|p|
            pagename = p.name
            if pagename == "Assembly"
              pgAssy = "yes"
            end }#if and each loop
            
            if pgAssy == "no"
              pages.add "Assembly"
            end#if
      

      thanks for looking
      Keith

      posted in Developers' Forum
      K
      ktkoh
    • Question about pages

      working on new plugin and I need to check the Text name of each existing page and this code does not work or give an error message. How should it be written?

      model = Sketchup.active_model
      selection = model.selection
      pages = model.pages
      pages.each {|name= page.name| UI.messagebox name}
      
      

      Thanks Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: No Selection Window

      Thanks that fixed the problem. I will look at the graphics drivers also

      Keith

      posted in SketchUp Discussions
      K
      ktkoh
    • No Selection Window

      I am running SU7 on a new Dell portable win7home and now I have no selection window. In the select mode when I press the mouse button to get the selection window nothing happens. Any ideas of what the problem is?

      Keith

      posted in SketchUp Discussions sketchup
      K
      ktkoh
    • RE: Ruby Question

      I added .name (Sketchup.active_model.selection[0].layer.name) and got exactly what I needed.

      Thanks
      Keith

      posted in Plugins
      K
      ktkoh
    • Ruby Question

      If I select a component and then start a script how can I find out what layer the selected component is on? I have looked at the ruby help and several script samples but could not find how to do this.

      Keith

      posted in Plugins
      K
      ktkoh
    • Ruby Help for Components & Layers

      I am trying to move a component created in a rb file to a new layer also created by that file. This code moves the enities so they are only visible on the new layer but when I check the Info the component is still on layer0. Is there a way to define the component layer knowing the name? Or is there a way to select the component knowing the name? (As I am able to change the layer of a selected component so I could make that work.)

      model = Sketchup.active_model
      model.start_operation "CreateBox"
      name = "WebTest"
      layerno = "01"
      
      # Create new layer for Part Assembly
            layers = model.layers
            newname = "A" + layerno + "-" + name
            if layers[newname]
      	 UI.messagebox("Layer \"#{newname}\" exists, exiting.")
      	 return
            end
            layer = layers.add newname
            pb = layer.page_behavior = LAYER_IS_HIDDEN_ON_NEW_PAGES
            model.pages.each { |p| p.set_visibility( layer, false ) }    
          entities = model.active_entities
      
          group = entities.add_group
          entities = group.entities
            
          pts = []
          pts[0] = [0, 0, 0]
          pts[1] = [10, 0, 0]
          pts[2] = [10, 1, 0]
          pts[3] = [0, 1, 0]
          base = entities.add_face pts
          
          width = -4if( base.normal.dot(Z_AXIS) < 0 )
          
          # Now we can do the pushpull
          base.pushpull width
          
          # Put entities on layer named "newname"
          entities.each{|e|e.layer=newname}
      
          # Now we are done and we can end the operation
          model.commit_operation
          
          # If you want the group to be a Component try the following.
          component_instance=group.to_component  
          component_instance.definition.name=name
          
          model.commit_operation
      

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: Some Ruby Help

      TIG thanks that worked like I needed it to. Next time I'll remember to add the code brackets. I am in the process of adding features to my makepart ruby and as someone wrote the monkey see monkey do coding only goes so far.

      Keith

      posted in Plugins
      K
      ktkoh
    • Some Ruby Help

      I am trying to set a layer to be visible on one page using the code:
      page = page.set_visibility layer visibility

      I have put this code in the ruby console and it runs without error but the layer is not visible on the page as I expected.

      model = Sketchup.active_model
      entities = model.entities
      selection = model.selection
      layers = model.layers
      pages = model.pages
      page = pages["Blank Page"]
      if (page)
      UI.messagebox page
      layername = "A01-Test"
      page = page.set_visibility ["A01-Test"], [true]
      else
      UI.messagebox "Failure"
      end
      

      Would someone help point out the error in my code?

      Keith

      posted in Plugins
      K
      ktkoh
    • RE: Mortise and Tenon Ruby

      I will try to explain with more detail.

      1. The board to have a mortise/tenon must first be a component.
      2. Rotate to a view where you can see the surface that will have the m/t.
      3. After selecting the tool the help text states select the component. Do this by mousing over the component and left mouse click.
      4. Next help text states select first edge parallel to mortise length. A typical m/t is longer than it is wide ( 2" x 1/4") so click one edge parallel to the longer m/t dim.
      5. Next help text states select second edge parallel to first edge. Click on that edge.
      6. Fill in the form with your dim. Edge1 to m/t length is the offset for the m/t from the first edge you selected. For a 1/4" mortise on a 3/4" board this would be .250 to center the mortise.
      7. The other edge to end for a 2" mortise on a 3" wide board would be .50 to center the mortise.

      I hope this helps
      Keith

      posted in Woodworking
      K
      ktkoh
    • 1 / 1