sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How to load all RBS files ?

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 4 Posters 2.8k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pingpinkP Offline
      pingpink
      last edited by

      Hello everyone,

      I have some problems of loading my test plugin which is already scrambled for .rbs files. 
      I don't understand the method to write .rb file to load all .rbs files in the folders.
      What should I write the loading code which I named it "cw_load.rb" ?
      There are many errors when I open in SketchUp 2014.
      

      This is the code in cw_load.rb

      #Sketchup;;require 'myFolder/myScript'
      
      Sketchup;;require 'CurtainWall_FStick.rbs'
      Sketchup;;require 'CurtainWall_FUnitized.rbs'
      Sketchup;;require 'CurtainWall_MainProgram.rbs'
      Sketchup;;require 'cw_archtoolbar.rbs'
      Sketchup;;require 'cw_report.rbs'
      Sketchup;;require 'cw_rubytoolbar.rbs'
      Sketchup;;require 'inputbox.rbs'
      Sketchup;;require 'CurtainWall/Components/Mullion_50/Mullion_50.rbs'
      Sketchup;;require 'CurtainWall/Components/Transom_50/Transom_50.rbs'
      Sketchup;;require 'CurtainWall/Components/Mullion_60/Mullion_60.rbs'
      Sketchup;;require 'CurtainWall/Components/Transom_60/Transom_60.rbs'
      Sketchup;;require 'CurtainWall/Components/Mullion_80/Mullion_80.rbs'
      Sketchup;;require 'CurtainWall/Components/Transom_80/Transom_80.rbs'
      
      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Something like..

        
        Dir["myFolder/*.rbs"].each do |filename|
          Sketchup.load(filename)
        end
        
        

        Link Preview Image
        Class: Dir (Ruby 2.1.2)

        Class : Dir - Ruby 2.1.2

        favicon

        (ruby-doc.org)

        Hi

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          What about:

          require("sketchup.rb")
          require_all("MyFolder")
          

          ❓

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • pingpinkP Offline
            pingpink
            last edited by

            I try to do , but I still don't know how to load all rbs files. 😒

            require 'sketchup.rb'
            
            Dir["pathFolder/*.rbs"].each do |filename|
            $path_root = "C;\Users\Windows8\AppData\Roaming\SketchUp\SketchUp 2014\SketchUp\Plugins"
            Sketchup;;load $path_root + "CurtainWall_FStick" 
            Sketchup;;load $path_root + "CurtainWall_FUnitized"
            Sketchup;;load $path_root + "CurtainWall_MainProgram" 
            Sketchup;;load $path_root + "cw_archtoolbar" 
            Sketchup;;load $path_root + "cw_rubytoolbar" 
            Sketchup;;load $path_root + "cw_report" 
            Sketchup;;load $path_root + "inputbox" 
            
            
            

            or this method ?

            require 'sketchup.rb'
            
            module CW
            
              # Menus and Toolbars
              unless file_loaded?( File.basename(__FILE__) )
                m = UI.menu( 'Plugins' )
             
              end
             
              PATH    = File.dirname(__FILE__)
              # Load scrambled files.
              Sketchup;;require( File.join(PATH, 'CurtainWall_FStick.rbs') )
              Sketchup;;require( File.join(PATH, 'CurtainWall_FUnitized.rbs') )
              Sketchup;;require( File.join(PATH, 'CurtainWall_MainProgram.rbs') )
              Sketchup;;require( File.join(PATH, 'cw_archtoolbar.rbs') )
              Sketchup;;require( File.join(PATH, 'cw_report.rbs') )
              Sketchup;;require( File.join(PATH, 'cw_rubytoolbar.rbs') )
              Sketchup;;require( File.join(PATH, 'inputbox.rbs') )
              
            end 
            
            file_loaded( File.basename(__FILE__)) 
            

            In the plugin

            1 Reply Last reply Reply Quote 0
            • pingpinkP Offline
              pingpink
              last edited by

              I revised in a new way , but I can load only the rbs files outside the folders.
              Inside the folders are rb files as it called every time when opening SU 2014.

              In the 'scramble.bat' in part of folder , I wrote this way.

              scrambler.exe CurtainWall/Components/Mullion_50/Mullion_50.rb
              scrambler.exe CurtainWall/Components/Transom_50/Transom_50.rb
              scrambler.exe CurtainWall/Components/Mullion_60/Mullion_60.rb
              scrambler.exe CurtainWall/Components/Transom_60/Transom_60.rb
              scrambler.exe CurtainWall/Components/Mullion_80/Mullion_80.rb
              scrambler.exe CurtainWall/Components/Transom_80/Transom_80.rb
              

              This is in a loadprog.rb to call all rbs files.

              require 'sketchup.rb'
              
              module CurtainWall
              
              this_dir=File.dirname(__FILE__)
              PATH=this_dir
              entries=Dir.entries(this_dir)
              ext=".rbs"
              Sketchup.load(File.join(this_dir,"CurtainWall_FStick.rbs"))
              Sketchup.load(File.join(this_dir,"CurtainWall_FUnitized.rbs"))
              Sketchup.load(File.join(this_dir,"CurtainWall_MainProgram.rbs"))
              Sketchup.load(File.join(this_dir,"cw_archtoolbar.rbs"))
              Sketchup.load(File.join(this_dir,"cw_rubytoolbar.rbs"))
              Sketchup.load(File.join(this_dir,"cw_report.rbs"))
              Sketchup.load(File.join(this_dir,"inputbox.rbs"))
              
              end
              

              I don't know there is a problem inside my folders , or I wrote in scramble.bat wrong ?

              1 Reply Last reply Reply Quote 0
              • A Offline
                AcesHigh
                last edited by

                Hi PingPinky. Is your curtainwall plugin available to download somewhere?

                1 Reply Last reply Reply Quote 0
                • pingpinkP Offline
                  pingpink
                  last edited by

                  Hello AcesHigh
                  Thank you so much for your interest !! It's a surprise that many people watched my videos. Actually , I did YouTube for a good memory , and applying for a job. Now, I'm preparing documentation for this time ,and looking for some experts to lead me here because I'm not a programmer. I hope there's a possibility to distribute soon.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    AcesHigh
                    last edited by

                    thanks for the answer Pingpink.

                    somebody opened a thread about your Plugin in the Plugins sections of Sketchucation just the other day. Can you please post more info there?

                    http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=58694%26amp;p=534451#p534229

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement