I have sent files by attachment, check your email Thomas: It can also happen that your browser may have pop-up screens blocked.
Posts
- 
RE: [Plugin][$] Concrete Stair Tool
- 
RE: [Plugin][$] Concrete Stair Tool@utiler said: I'll dive in first, Tomot! Ching, ching!! EDIT: aahhh... password please?  with thanks! ...check your email! 
- 
[Plugin][$] Concrete Stair ToolI 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! 
- 
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!  
- 
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? 
- 
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! 
- 
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 constantsIDYES,IDNOorIDCANCEL, 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. 
- 
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  
- 
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"
- 
RE: Using the Cancel btn, to return to previous menu?@jim said: Not often used, but Ruby has a loop statement. Just breakout 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.
- 
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"
- 
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. 
- 
RE: Using the Cancel btn, to return to previous menu?@jim said: Have a look at the inputboxmethod in Sketchup.rb (Tools folder.) It shows an example of usingbegin..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. 
- 
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
- 
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 
  
- 
RE: Circle orientation other than Z_axis?@tig said: An edge has a 'line'. point=edge.line[0]andvector=edge.line[1]circle = entities.add_circle(@pt1, Z_AXIS, 1.inch, 16)do I replace the Z_AXIS code with your code? 
- 
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)
  
- 
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
  
- 
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 > > endfixed 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