To create script I need to add GEM to Sketchup's Ruby
-
I am writing a ruby script that will take an image and create the lines and curves in Sketchup components so that you can start building from there. To do this I need to import a GEM. I have Sketchup 8 and 2013. I can't find a way to import it.
I was able to import the GEM into my MAC OS Ruby. But I can't find a way to upload the GEM file into Sketchup.
-
Look through threads in the Developers' forum.
The PC Ruby version is an old cut-down thing...
Dan Rathbun has done several pages on using extra Ruby functions inside SketchUp's Ruby...
It is not that straightforward...
Use the Search facilities...
http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=25233 -
@tig said:
It is not that straightforward...
And it would be problematic to distribute such an extension.
Best alternative would be to copy the modules you need and wrap it into your own namespace (to avoid collision with other extensions.)
-
Yes
I have also looked at 'packaging' other Ruby methods with mine to give extended functions in distributed scripts [I gave up!].
The real complexity is that as soon as you look to import one new moved over method, then you'll almost certainly find that it includes 'requires' for several other files, these files in turn require other files and so on.
You'll end up with a massive tangle of files/subfolders 'requiring' other files ad nauseam, and one mistype/misplaced line of code breaks everything - makings untangling it all very very hard...
Advertisement