Missing standard rb files


I see lots of advice and code examples recommending to
require 'sketchup.rb’
require 'extensions.rb’
require 'langhandler.rb’
which are supposed to be installed in the plugins folder.
I’m using Sketchup Pro 2015 and don’t see those files anywhere?

Am I missing something?


The location of these files has changed with SketchUp 2015. They are now in the Tools folder inside the SketchUp application folder in Program Files.



These three special RB files are NOT meant to be in the Plugins folder [EVER! - on very old setups they were in Plugins but NOT for years…]
They are shipped in the Tools folder.
That is where they belong.
They UI and menu additions, Extensions methods and Translation methods…

The $: contains various folders that you can require files from, including the Plugins and Tools folders [and the Tools/RubyStdLib folder etc].
The Ruby files within the Plugins folder, and then the Tools folder, are auto-loaded as SketchUp starts,
For files within other paths you need to use require.
If you have an RB file loading from Plugins that needs some methods from the three special files in the Tools folder, then you require it before you need to use it.
If you wait until the file loads from the Tools folder, then it will be too late, and your earlier loading script code will have failed with an error.
If you use require on a file, then it will load if it has not been loaded before during that session, but otherwise it is just skipped over…
So there is no harm in using a require on a file from within Zebra.rb, which has almost certainly been required already by Aardvark.rb as it loaded in alphanumeric order…
It’s just the safe option…


On my system, these three files are placed in the following folder locations for SketchUp Pro 2015

C:\Program Files\SketchUp\SketchUp 2015\Tools\RubyStdLib
C:\Program Files (x86)\SketchUp\SketchUp 2015\Tools\RubyStdLib

I also located a plug ins folder at the following location

C:\Program Files\SketchUp\SketchUp 2015\Plugins\TT_Lib2
(Note that this folder contains sketchup.rb among other rb files but does not include extensions.rb or langhandler.rb.)

You may need to unhide system folders in order to see these files.


That is not a standard folder created by the SketchUp installer. Have you copied your Plugins folder over from an older installation of SketchUp?



That is probably the case. Am I correct to assume that this Plugins folder could be (or should be) deleted?


If you are not sure, start by moving or renaming it, and remove it only after you have verified that everything still works as expected.

The new location for the Plugins folder is

C:\Users<Your user name here>\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp\Plugins



Got it. Thx. Everything still works perfectly. I think I must have copied the plugins folder from SU 2014 or earlier over to the new release.


For the avoidance of doubt !
Type this + [enter] in the Ruby Console:
The returned text includes the actual paths to the …/Plugins folder, the …/Tools folder and two …/Tools/RubyStdLib folders - there might also be a …/ProgramData/…/Plugins folder [or even others] if you have installed a proprietary Plugin [but you can ignore those]…

All installed RBZ files go into the users’ default ‘Plugins’ folder.

The three ‘shipped’ system RB files are now always supplied in the ‘Tools’.

It’s recommended that [wherever possible] you reinstall ALL Plugins when getting a new version of SketchUp, that way you get the latest version which might have been updated to suit the latest version.
If you have copied the contents of the v2014 Plugins folder into v2015’s equivalent folder it’s unlikely that there are many issues, but copying earlier Plugins folders will probably result in loading or launch errors !
If you do ill-advisedly copy a very old Plugins folder OR you have installed some ‘rogue’ Plugins… then you might get duplicate [out-of-date] RB files in the Plugins folder, when only the Tools folder’s versions should exist/load [i.e. for the magic-three: sketchup.rb, extensions.rb and langhandler.rb] - delete the ones that are NOT in …/Tools…


Is there any reason that the classes and methods defined by “magic three” hove not been incorporated into the native SketchUp object model?


Wonderful advice TIG. I appreciate you taking the time to so clearly explain all of this. I ran into a problem with load errors resulting from an issue unrelated to this post a few weeks ago, but it was resolved swiftly when I described my concerns in this forum


I suspect the ‘three’ being in Tools, is more historical than practical…
Although ‘SUp’ could load all of the three’s functionality from within its main code… and have ‘empty’ placeholder RB files in Tools, so that older Plugins didn’t fail when their ‘require’ failed…

And of course the >=v2014 incorporation of Ruby files in a Tools subfolder gave new impetus to the Tools folder !

For now follow what works…


Thanks all. Is there a standard window 7 way to unzip .RBZ files? Or a non trojan UNPACKZIP virus supplier to run in the CMD window (or elsewhere)

secondly, is there a reference to how one calls the methods in some sketchup (2015) classes that are equivalent to ORBIT (most priority) and PAN. I am setting my Camera to Orthographic!
Thanks in advance. JR Sannerwind@gmail.com


[quote=“sannerwind, post:13, topic:6152”]
Thanks all. Is there a standard window 7 way to unzip .RBZ files? Or a non trojan UNPACKZIP virus supplier to run in the CMD window (or elsewhere)
[/quote] I expect a typo, in that youe are not asking for ‘virus’, but a ‘decompression’ app ??
IF you must upzip an RBZ file simply change its file-type suffix [change you folder-options to display ALL file types…] change .RBZ to []or append] .ZIP.
Then you can upzip it using built-in tools…
There are MANY free zip/unzip tools available…
Google for them and check their credentials…


[quote=“sannerwind, post:13, topic:6152”]
secondly, is there a reference to how one calls the methods in some sketchup (2015) classes that are equivalent to ORBIT (most priority) and PAN. I am setting my Camera to Orthographic!Thanks in advance. JR Sannerwind@gmail.com
[/quote] Look at the API Sketchup.send_action(…)
You can also access aspects of the view’s ‘camera’ via the appropriate methods in the API.

You might need to make a Tool to mimic moving the camera dynamically…


What TIG said:

I don’t know the history of why it was done so - it’s too long ago. But we have been talking about autoloading these to make these require statement redundant. That would take care of load errors that happen when people forget to include it and they are the first or only extension to load.


There appear to be many different topics in this thread. It’d be easier to track the conversation if they had their own thread.


**Hi all, thnks for the inside scoops. I found and documented a bug in Sketchup Make 2015 for windows. can you please tell me how to post this to the attention of the compiler guru’s and the users?
thanks -> Jay R email me Sannerwind@gmail.com