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: Problem with API or my plugin?

      This is the first time I didn't get a response on a code question. However by making this test plugin I did find out what was wrong with the results on the counter clockwise edge selection and this has led to a much simpler work around to clean up the push pull results. I am running a code that looks for edges with 0 or 1 face attached and removing them then loop thru again as the first loop exposes additional edges with 0 or 1 face only. I still think the code is correct and there is a bug in SketchUp API when a pus pull face intersects the outside edge. I have seen this in other code I have written.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • Trying to set global axis from API
      xaxis = Geom;;Vector3d.new(3, 5, 0)
      yaxis = xaxis * Z_AXIS
      Sketchup.active_model.axes.set([10,0,0], xaxis, yaxis, Z_AXIS)
      

      when I use this API example I get the error message:
      undefined method ‘axes’ for #Sketchup::Model:0x9815c70

      What I am trying to accomplish is to draw a rectangle that is the outside extents of a face.
      Similar to a bounding box for the face except the bounding box aligns with the global axes and thus for some faces is 3 dimensional not single plane

      So I am trying to align the Global Axes with a face to create a bounding box that matches the face plane. Then reset Global Axes to Default

      posted in Developers' Forum
      K
      ktkoh
    • Problem with API or my plugin?

      My Dovetail plugin as always had this problem and I have worked around it but I finally started to investigate to see what was actually happening. I have reduced the tail board plugin to its min so it requires no data input and only draws the edges on the board face that when pp for the thickness should create tails.

      Now here is the problem:
      The program asks the user to select in this order Comp, thickness edge, width edge, and length edge. On one end of the board the tails will be formed correctly on the other end there will be extra faces and edges remaining. If you select the width edge and then the length edge in a clockwise rotation the tails will be correct. However if width to length is in a counter clockwise rotation the tails are not completed.

      I have found the cause which is in the cc direction the faces that will be pushed pulled to create the tails are duplicated.

      Will you look at this to see if it is something the program is doing or a problem with forming faces that intersect edges in the API. I have included the rb file and a simple board file for testing. Or you can make your own board comp ( all corners 90 deg ).

      The 2 push pull lines are commented out if you make these functional then the program will attempt to complete the tails.


      K2_TestPushPull.rb


      DovetailSide.skp

      posted in Developers' Forum
      K
      ktkoh
    • Portable computer for su 2017

      I use sketchup for my wood working hoby. As such I am looking for the absolute min config that will run 2017 make. I have been happy with the performance with graphics acceleration turned off in ver 8 thru 2016. However I am having disc errors so computer is no longer reliable. Any one have sucess runing on the built in graphics?

      Keith

      posted in SketchUp Discussions sketchup
      K
      ktkoh
    • RE: Boolean solid vs surface?

      I tried the original bootools on your sample and it left the top cube with some lines to clean up. I still use it on SK2015 however I cant run 17 on my portable so I don't know if it runs on that version.

      posted in SketchUp Discussions
      K
      ktkoh
    • RE: User ending a program

      The program I used as a model when starting used that method. However as I added more functions it became almost impossible to find how to get out to the end of the mouse click down def.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: User ending a program

      Thanks Dan that really helped me. I had never run across the term fail() and was able to research this in the ruby help files I use. I have tested it in my program and find it works as you described.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • User ending a program

      I have used "exit" in my joint tool program for cases where the user's selection was in error or when a data form asked for input that the user did not have so they selected cancel. I do see that this produces an error message in the ruby console so I am asking if this is unacceptable practice? I found that if the space bar is pressed the selection tool is activated and my tool dropped but Sketchup.send_action "selectSelectionTool:" does not do anything.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: Pre Save Observer

      Thanks. That was just what I needed.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • Pre Save Observer

      I am trying to implement a pre save observer. This is an example of the file. This works on the current model if I load the file after the model is open. However if I bring up a new model and then save it this observer does not see the save operation. Suggestions on how to make it work on each model I save??

      Keith

      require 'sketchup.rb'
      # This is an example of an observer that watches the
      # model save event.
      module K2WS
      class MyModelObserver < Sketchup;;ModelObserver
      def onPreSaveModel(model)
      UI.messagebox("PreSaveObserver")
      end
      end
      # Attach the observer.
      Sketchup.active_model.add_observer(MyModelObserver.new)	
      end # K2WS
      
      posted in Developers' Forum
      K
      ktkoh
    • RE: 2017 Fails Installation

      I also posted this on the sketchup forum and got the anser that I would need a graphics card to run 2017 as it does not run with graphics accelleration turned off like I have always used it. This will leave a lot of users of make not able to up date beyond 2016. I wanted to test the plugins I wrote to see if they ran under ruby 2.2 which is new in 2017
      Keith

      posted in SketchUp Discussions
      K
      ktkoh
    • 2017 Fails Installation

      Using Make on a Dell Inspiron 1545 Windows 7 64 bit installation hangs up on Installing Universal CRT(Hotfix KB2999226) times out after 10 min. I checked for updates noting recommended rebooted and same result.

      posted in SketchUp Discussions sketchup
      K
      ktkoh
    • RE: Top Level Component or Group

      Thanks that worked and after seeing it correct it makes sence.

      KeitH

      posted in Developers' Forum
      K
      ktkoh
    • Top Level Component or Group

      I am trying to detect a top level Component or Group from a nested one.

      if ((obj.is_a? Sketchup;;ComponentInstance) || (obj.is_a? Sketchup;;Group) &&
      					(obj.parent.is_a? Sketchup;;Model))	
                    popup.add_item(C2LAYSCENE) {
                      #
                      part_2_layer_command
                      #
                    }
                    popup.add_item(C2SCNE) {
                      #
                      shopDrawingCommand
                      #
                    }
                end # Single part test  
      

      This test fails and when the user has selected a nested comp/grp I still show these commands.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: How to run a frame change observer

      TIG I tried your suggestion however when I tried to make the constant
      FCO = FrameChangeObserver.new()
      I always get the error
      Error Loading File FrameChange.rb
      Error: #<NameError: uninitialized constant K²WS::FrameChangeObserver>
      C:/Users/Keith/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/FrameChange.rb:6:in <module:K²WS>' C:/Users/Keith/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/FrameChange.rb:5:in <top (required)>'I am obviously using it in the wrong context.

      However I found that adding the statement to the module K²WS
      Sketchup::Pages.add_frame_change_observer(FrameChangeObserver.new)
      worked. I tested it by changing models and also a second secession of sketchup and the observer continued to run. I feel that the model observer as you suggested may not be required.

      Thanks
      Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: How to run a frame change observer

      Thanks for the reply. I will try that and report back on how that worked for me.

      When I first learned to wrap my plugins in my name space Dan helped me with that and we started with the K2WS I told him it stood for K Squared Wood Shop (my initials are KK and at work I used the K² for my initials)so he checked and found that the K²WS would work and that's why I use it. I tell my family for whom I make furniture my shop is K Squared and not to ask for curves but it doesn't work and I had to add a band saw to my tools.

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • How to run a frame change observer

      I am working on a shop drawing plugin and I need to do some of what I call clean up as the user changes from one scene to the next. The code I have come up with will run clean up on the from scene as desired. Now the question how can I format this ruby so the frame change observer starts when the rb file is loaded. (with out the user clicking on a menu or toolbar)

      require 'sketchup.rb'
      require 'k2ws_Dovetails/k2ws_module.rb' #-NameSpace Module
      
      
      module K²WS
      		
      #Define the Frame Change Observer which is documented in the Pages class.
       
      class FrameChangeObserver 
      
      def initialize 
      	
      	# @run_CleanUp is used to determine if cleanUP should be activated 
      	@run_CleanUp = true
      
      end 
      
      
      # When frameChange is first triggered by User clicking on a new Scene
      # the selected page name points to the from Scene that may need to
      # be cleaned up by moving enities on Layer0 to the proper Layer.
      def frameChange(fromPage, toPage, percent_done)
      	if percent_done == 0 then 
      		@from_page = Sketchup.active_model.pages.selected_page.name
      		if @run_CleanUp == true then clean_Layer0 end
      		#Debug  
      		UI.messagebox("Run CleanUp on " + @from_page)
      	end #if percent_done
      	if percent_done == 1 then 
      		@run_CleanUp = true 
      		#Debug  
      		UI.messagebox("Reset @run_CleanUp = true")
      	end #if percent_done
      	
      end
      
      def clean_Layer0
      	#Debug  
      	UI.messagebox("Clean_Up would run")
      	@run_CleanUp = false
      end #clean_Layer0
      
      end 
      
      def self.frameChange
      	id = Sketchup;;Pages.add_frame_change_observer(FrameChangeObserver.new)
      	# Debug  UI.messagebox("Started Frame Change Observer")
      end 
      
       unless file_loaded?(File.basename(__FILE__))
      	 UI.menu("Tools").add_item("FrameChange"){frameChange}
       end
      	 
      end #module K²WS
      

      Keith

      posted in Developers' Forum
      K
      ktkoh
    • RE: [Plugin] GKWare Cabinet Maker

      The hall wall with the special base cabinet at the endGary: Thanks for a great plugin for designing and detailing cabinets. One of the latest changes I like is placing the cabinet by a back corner. It is much easier to locate guide lines on a wall than out in space. Earlier I posted a video of the kitchen I am working on for my Grandson and after some revisions have completed it. I was even able to make a special corner cabinet by combining 2 standard cabinets then manual editing the individual parts.

      The report lists are very complete and will be very useful in the shop.

      Your support has been amazing as I reported some issues they were fixed by the next time I checked forum.

      Keith

      posted in Plugins
      K
      ktkoh
    • RE: [Plugin] GKWare Cabinet Maker

      One other thing once I saved rules and material then used sav as an named the file I could retreive those settings. However after updating the plugin the materials and rules reverted to the default. The cabinet sizes retained my settings.

      Also it would seem to me that when editing a cabinet the materials used should show up on the form. The program must know these to make the proper changes. I would not want to change the design by just editing the width or depth etc.

      Keith

      posted in Plugins
      K
      ktkoh
    • RE: [Plugin] GKWare Cabinet Maker

      Gary here is video of the kitchen I designed for my grandson. On the last wall shown the end cabinet was made by using the Angle cabinet then replacing the blank front with a door and drawer from a base cabinet the width of the blank face.

      I have noticed that selecting save for rules and materials seems to make nothing happen. When starting a cabinet the save as results in window to name or select the file but not at the materials or rules tab.

      I like the help pictures shown now when working in the forms. Very Helpful.

      Keith

      posted in Plugins
      K
      ktkoh
    • 1 / 1