Require 'sketchup.rb'
-
is it strictly neccesary to include this in my plugins? Ive been going without so far and everything seems to work ok, so what advantage is there to using it in every plugin?
-
On the odd chance that your script is loaded before any other script that does require 'sketchup.rb', and your script uses any methods defined by 'sketchup.rb', your script will fail to load. This is most commonly seen if you use file_loaded?(file) or file_loaded(file) at the end of your script.
A sure-fire example would be if a user new to plugins happened to download a script that did not require 'sketchup.rb' but did use one of the 'sketchup.rb' methods. Having no other .rb files in their plugins folder, they would get a load error straight away, complain to you, and you'd end up putting it in anyway.
Not that this particular scenario has ever happened (well, not more than a few times, anyway - I know I've read about that scenario, I think on the original SU Ruby forum).
-
That makes sense, i'll start adding it in
-
You can open the Sketchup.rb to see what is included in it.
Chris
Advertisement