How to load all RBS files ?
-
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'
-
Something like..
Dir["myFolder/*.rbs"].each do |filename| Sketchup.load(filename) end
-
What about:
require("sketchup.rb") require_all("MyFolder")
-
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__))
-
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 ?
-
Hi PingPinky. Is your curtainwall plugin available to download somewhere?
-
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. -
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
Advertisement