sketchucation logo sketchucation
    • Login
    1. Home
    2. tomot
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    T
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 116
    • Posts 703
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: [Plugin][$] Concrete Stair Tool

      I have sent files by attachment, check your email Thomas: It can also happen that your browser may have pop-up screens blocked.

      posted in Plugins
      T
      tomot
    • RE: [Plugin][$] Concrete Stair Tool

      @utiler said:

      I'll dive in first, Tomot!

      Ching, ching!!

      EDIT: aahhh... password please? πŸ˜‰

      with thanks! ...check your email!

      posted in Plugins
      T
      tomot
    • [Plugin][$] Concrete Stair Tool

      I originally developed several Stair Rubies back in 2004 under various nym's. My intent was to make various Stair Rubies that satisfied North American Building Code standards. I now have revisited that subject to include Railing options and Component Placement in 4 new rubies. And Since Railings/Balusters are part of Stair Design in Buildings, I will, include via attachment, a copy of Baluster Tool Ruby to each person who is interested in acquiring my new Stair Concrete Tools Ruby. The Scripts came in both Metric and Imperial versions.
      For more information click on my plugins below. ....Happy Halloween! πŸŽ‰

      posted in Plugins
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      Thanks TIG:

      I would never have been able to figure out the self.run routine on my own! πŸŽ‰

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      @tig said:

      Learn web-dialogs and then you can have any buttons you want, called anything you want, doing anything you desire... πŸ˜•

      Luckily I have shortened my list of things that I desire. However if I were, and if I was my 20's, I would not waste my time learning web-dialogs. I'd learn COBOL, an almost extinct language, yet COBOL still runs 90% of the worlds financial programs. And since there are almost no COBOL programmers left, since most have or are retiring. One could make a great deal of money learning COBOL instead of Web-dialogs. πŸ˜„

      However that still does not answer my followup question: why does the Cancel dialog not display with your included revisions?

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      @dan rathbun said:

      You only have two choices to construct dialogs with custom controls:

      (1) Write native code for the platform your on, making system calls. (Very low-level nitty gritty advanced programming.)

      (2) Write a WebDialog and use a HTML form.
      ]

      There is a (3) option. Maybe Trimble will add some more stuff to the SketchUp Ruby API, however I'm not holding my breath!

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      @dan rathbun said:

      Another sub-type of dialog box, is the messagebox. With that you CAN specify the button set, using constants that begin "MB" (such as MB_OK, MB_YESNOCANCEL, etc.)
      With a messagebox, you DO check the integer return value against the constants IDYES, IDNO or IDCANCEL, etc.

      Dan thanks for your comments. which raises one question. Would it then be possible to construct a single dialog box with a 3rd button ie. Calculate btn? Which in my example would calculate the division.

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      @tig said:

      You haven't followed my template πŸ˜’
      Try this...

      I tried your code, but it does not produce an on screen dialog either 😒

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      Short of tearing my hair out, of which I already have too few to part with. I don't seem to be able to get any menu to appear each time I add @results to my cancel.rb script. Neither does the ruby console identify any errors.

      I suppose part of my problem is not understanding how "OK" and "Cancel" magically become part of any dialog box. There is no specific Ruby code identifying either of those terms, in the script.

      =begin
      # Name;           Cancel 
      # Description;    Initiate Cancel routine in Dialog Box #2
      #                 returning user back to Dialog Box #1
      # Date;           2012/21/08
      # revised         2012/03/09 not working! 
      #--------------------- ------------------------------------------------------
      =end
      require 'sketchup.rb'
      
      module CANCEL        
      #---------------------------------------------------------------------------
              #Set default settings
              @height = 9.feet if not @height # floor to floor height    
              @riser = 16 if not @riser       # no. risers total    
              
          def self.cancel    
          
              # Dialog box #1
              def dialog1()
              prompts = ["Floor/Floor Height ", "No. Risers"]
              values = [@height, @riser]
                  @results1 = inputbox prompts, values, "Dialog Box #1"
                  if @results1
                      dialog2()
                  else
                      return nil
                  end
              end
              
              return if not @results1
              @height, @riser = @results1
              
              
              @riserheight=@height/@riser  # riser height
            
              # Dialog box #2
              def dialog2()
              prompts = ["My RiserHeight  ", "--------"]
              values = [@riserheight, @any_entry]
                  @results2 = inputbox prompts, values, "Dialog Box #2"
                  if @results2 
                  
                  else
                      dialog1()
                  end    
              end
              
              return if not @results2
              @riserheight, @any_entry = @results2
               
          end #self.cancel 
      end #module CANCEL  
      #---------------------------------------------------------------------------
          if( not file_loaded?("cancel.rb") )
              UI.menu("Plugins").add_item("Cancel") { CANCEL.cancel }
          end
      #---------------------------------------------------------------------------
          file_loaded("cancel.rb") # load"cancel.rb"
      
      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      @jim said:

      Not often used, but Ruby has a loop statement. Just break out of the loop when proper input is entered.

      This example has nothing to do with the user entering improper input. The results of the
      of the 1st dialog box are entered into the 2nd dialog box. Its really a very poor example of a calculator, in Ruby. Ideally I would like the division to take place and displayed in 1st dialog box.

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      TIG: I have been struggling with applying your code: Would you be so kind to attach your code to my simple example, TIA!

      =begin
      # Name;           Cancel 
      # Description;    Initiate Canel routine in Dialog Box #2
      #                 returning user back to Dialog Box #1
      # Date;           2012/21/08
      #---------------------------------------------------------------------------
      =end
      require 'sketchup.rb'
      
      module CANCEL        
      #---------------------------------------------------------------------------
              #Set default settings
              @height = 9.feet if not @height # floor to floor height    
              @riser = 16 if not @riser       # no. risers total    
              
          def self.cancel    
          
              # Dialog box #1
              prompts = ["Floor/Floor Height ", "No. Risers"]
              values = [@height, @riser]
              results = inputbox prompts, values, "Dialog Box #1"
              
              return if not results
              @height, @riser = results
              
              @riserheight=@height/@riser  # riser height
            
              # Dialog box #2
              prompts = ["My RiserHeight  ", "--------"]
              values = [@riserheight, @any_entry]
              results = inputbox prompts, values, "Dialog Box #2"
              
              return if not results
              @riserheight, @any_entry = results
              
          end #self.cancel 
      end #module CANCEL  
      #---------------------------------------------------------------------------
          if( not file_loaded?("cancel.rb") )
              UI.menu("Plugins").add_item("Cancel") { CANCEL.cancel }
          end
      #---------------------------------------------------------------------------
          file_loaded("cancel.rb") # load"cancel.rb"
      
      posted in Developers' Forum
      T
      tomot
    • RE: Circle orientation other than Z_axis?

      It took a while for your medication to be absorbed πŸ˜„

              vector = $pt2a - $pt1a
              edges1 = entities.add_edges($pt1a, $pt2a)
              circle = entities.add_circle($pt1a, vector, 1.inch, 16)
              base = entities.add_face(circle)
              base.back_material = Sketchup;;Color.new (255,200,100) #use RGB Color numbers
              base.followme(edges1)
      

      using my coded example: subtracting the 2 points creates a 3d vector which is normal to any circle.

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      @jim said:

      Have a look at the inputbox method in Sketchup.rb (Tools folder.) It shows an example of using begin..rescue..retry..end.

      Since there are 2 inputboxes in my example, or maybe more depending on the complexity of a particular Ruby script. I still don't see how I can control revisiting any inputbox in a script. Is there no inputbox identity name, which I could use to control via Cancel the direction a particular ruby would branch to. At the moment the only alternative I have, is to restart the script.

      posted in Developers' Forum
      T
      tomot
    • RE: Using the Cancel btn, to return to previous menu?

      Its something code wise I never was concerned about. Since there would normally be no reason to return to a previous menu. Presently the second menu on OK initiates the drawing routine, and on Cancel does nothing. 😞
      Here is the code for Dialog box in question

              # Dialog box
              railg = ["Both Sides", "Right only", "Left only", "None"]
              rail = ["Both Sides", "Inner only", "Outer only", "None"]
              enums = [ "", railg.join("|"), rail.join("|")]
              prompts = ["My RiserHeight  ", "Rails + Glass", "Rails - Glass"]
              values = [@ssincrt, @railg, @rail]
              results = inputbox prompts, values, enums, "Railing; Pick one option Only"
              
              return if not results
              @ssincrt, @railg, @rail = results
      
      posted in Developers' Forum
      T
      tomot
    • Using the Cancel btn, to return to previous menu?

      The evaluation of My RiserHeight can only take place after the orignal values are entered in the previous menu. If the value of My RiserHeight is not within code limits, I want to use Cancelto return to the previous menu.

      What's the ruby code that will allow me to do this? TIA


      menu.png

      posted in Developers' Forum
      T
      tomot
    • RE: Circle orientation other than Z_axis?

      @tig said:

      An edge has a 'line'.

      point=edge.line[0] and vector=edge.line[1]

      circle = entities.add_circle(@pt1, Z_AXIS, 1.inch, 16)
      

      do I replace the Z_AXIS code with your code?

      posted in Developers' Forum
      T
      tomot
    • Circle orientation other than Z_axis?

      I'm in need for some code to orient a circle forming a stair railing, which needs to be normal to the riser/tread triangular relationship
      see attachment.

          edges = entities.add_edges(@pt1, @pt2)
          circle = entities.add_circle(@pt1, Z_AXIS, 1.inch, 16)
          base = entities.add_face(circle)
          base.back_material = Sketchup;;Color.new (255,200,100) 
          base.followme(edges) 
      

      extrusion.png

      posted in Developers' Forum
      T
      tomot
    • RE: Is this a ruby bug?

      great! "\" works, thanks for the explanation.

      posted in Developers' Forum
      T
      tomot
    • Is this a ruby bug?

      I'm creating a cross brace ruby, with left or right bracing options
      I wanted to use the keyboard "" to define the brace direction in the dialog box


      bug.png

      posted in Developers' Forum
      T
      tomot
    • RE: How to reset an incremental value used in an if statement?

      @thomthom said:

      @tomot said:

      thanks 2 both if u

      if @fix >=@flenx/2-@fcol
      > >    @fix = @flenx/2-@fcol
      > > end
      

      fixed the issue πŸ˜„

      ?

      So what you really asked for was how to ensure a maximum value?

      NO! ...the original value @fix = 60 just happened to be the result of 2 user selected variables, @flenx & @fcol. When the "while..end" loop finished the value of @fix = 432 I now needed to reset @fix back to its original user selected value.
      I had been looking in the API, thinking there might be a 'reset' comment 😳

      posted in Developers' Forum
      T
      tomot
    • 1
    • 2
    • 6
    • 7
    • 8
    • 9
    • 10
    • 35
    • 36
    • 8 / 36