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

    Posts

    Recent Best Controversial
    • How do you install Nokogiri for SketchUp?

      Hello, I have been combing the internet to try and find out what files I need to put where so I can get Nokogiri to work in the SketchUp ruby console. I installed Nokogiri using - gem install nokogiri.

      How do I get it to work with SketchUp? What files do I take from where to where? In the beginning of the ruby files do I simply put "require 'nokogiri'" or is there more to it than that?

      I got REXML to work which was fairly easy, just moved the whole REXML file into /plugins and the set.rb file as well. Then in the begin of rb files write -
      require "rexml/document"
      include REXML

      Shouldn't the process be similar for Nokogiri?

      Please help, I am losing my mind.

      Thank you.

      posted in Developers' Forum
      H
      haebooty
    • RE: Novice Ruby Questions - Regarding dropdown windows

      Yes I did thank you 😄

      posted in Newbie Forum
      H
      haebooty
    • Novice Ruby Questions - Regarding dropdown windows

      Hello. I am new to ruby and sketchup and have been trying to learn. I had a question regarding drop down windows. I was looking at an example I found from T. Burch at ruby library depot called dropdown.rb, which was very helpful. In my experimenting I have been unable to figure out how could you make it so the dropdown windows are in say slot 2-4 instead of 1-3.

      Here is his example:

      require 'sketchup.rb'
      var1 = "Last Choice"
      inputbox1 = %w[Choice1 Choice2 Choice3 Choice4].join("|") 
      inputbox2 = %w[Option1 Option2 Option3 Option4].join("|")  
      inputbox3 = %w[Selection#1 Selection#2 Selection#3].join("|") 
       
      array_of_dropdowns = [inputbox1, inputbox2, inputbox3]    # An array of arrays
      
      if !@val1 then @val1 = "Choice1" end       # Assigning instance variables, they are remembered each 
      if !@val2 then @val2 = "Option2" end       # time the script is run in a session.  
      if !@val3 then @val3 = "Selection#3" end   # These values must match one of the array values!!!
      if !@val4 then @val4 = 4 end               # Otherwise, no value is displayed as a default choice.
      
      prompts = ["Choose your Choice", "Opt your Option", "Select your Selection   ", "Enter a Number"]
      
      values = [@val1, @val2, @val3, @val4]   
      
      @val1, @val2, @val3, @val4 = inputbox prompts,values, array_of_dropdowns, "Multi-Drop Down Example"
      
      print "variable @val1 is ", @val1, "\n" 
      print "variable @val2 is ", @val2, "\n" 
      print "variable @val3 is ", @val3, "\n" 
      print "variable @val4 is ", @val4, "\n" 
      

      Is it possible to make it so, enter number is at the top and then is followed by the three dropdown menus: choice, option, and selection? Any help would be greatly appreciated. Thank you in advance.

      posted in Newbie Forum sketchup
      H
      haebooty
    • 1 / 1