• Login
sketchucation logo sketchucation
  • Login
🤑 30% Off | Artisan 2 on sale until April 30th Buy Now

How to load all RBS files ?

Scheduled Pinned Locked Moved Developers' Forum
8 Posts 4 Posters 2.8k Views
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.
  • P Offline
    pingpink
    last edited by 8 Jun 2014, 08:02

    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 8 Jun 2014, 15:25

      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
      • D Offline
        Dan Rathbun
        last edited by 8 Jun 2014, 18:19

        What about:

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

        ❓

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • P Offline
          pingpink
          last edited by 9 Jun 2014, 00:25

          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
          • P Offline
            pingpink
            last edited by 11 Jun 2014, 03:30

            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 6 Aug 2014, 00:23

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

              1 Reply Last reply Reply Quote 0
              • P Offline
                pingpink
                last edited by 6 Aug 2014, 08:18

                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 6 Aug 2014, 14:14

                  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