Importing SVG
-
@cloo said:
Hi,
I can`t get svg.rb working.
The plugin requires REXML ruby library (what is not clearly stated), and even having that in SU7.1 produces a cryptic error:Do you have an idea what`s the problem, and can anybody import SVG to sketchup at all?
If you read the file early on it requires a file
require 'rexml/parsers/pullparser.rb'
this is where it's failing
Inside the Plugins folder you need a folder calledrexml
, inside that a folder calledparsers
and inside that a file calledpullparser.rb
- I suspect that that file will also have require/load set for other files in the folder so you need to check that too...This IS explained in the linked web-site as:
@unknownuser said:This script allows to use Inkscape to create 2D images and to create Sketchup group(s) from the SVG File Inkscape has written.
The script requiresrexml
: You will find the files in a standard ruby environment: Copy the rexml Folder to your Sketchup Plugins Folder.
You will also need theforwardable.rb
andset.rb
from ruby in your Plugins Folder.
You might think that therexml
is here http://www.germane-software.com/software/rexml/ [Development.zip and API_Docs.zip downloads] - and you'd will need to rename its copied folder as justrexml
inside ../Plugins/ BUT it doesn't contain 'pullparser.rb
' SO DON'T BOTHER !!! You actually need a full version of Ruby instead http://www.ruby-lang.org/en/ and copy the rexml folder from that !!! Aaargh! This is perhaps the least painful route http://rubyinstaller.org/downloads/ Copy this folder into ../Plugins/
and the other two.rb
files here http://www.koders.com/ruby/fidFC6B854727851FAB8FC100CF0B7AB5BAE3F3F7B3.aspx?s=open3 [click Download link on left] and here http://www.koders.com/ruby/fidD93919848069320713B57FAB7E319C679FD5CA55.aspx?s=open3 [click Download link on left] - these go into ../Plugins/It could have been made a whole lot easier !
PS: It also needs
bezier.rb
which you can get from here... http://sketchup.google.com/download/rubyscripts.html -
Thank you TIG! Life is much easier with folks like you. .
I`ll try to give something in my turn, too.
Here is the plugin with all the needed scripts: svg.rb and all the scripts that it requires: rexml library, bezier.rb, forwardable.rb and set.rb -
Just so you know, we've had this posted back in 2008 (but now removed)
http://forums.sketchucation.com/viewtopic.php?f=180&t=13475
The problem is the file set.rb uses a Set class that is in conflict with SketchUp's built-in Set class, which can cause other plugins which rely on the Set class to fail (in sometimes subtle ways that are hard to debug.)
It may be possible to fairly easily wrap the entire plugin in a unique namespace, but I don't think anyone has tried it.
-
Yes, I found that.
But I think that declaring this incompatibility is much better than removing a possibility - so you don`t ban people from using a function when necessary. -
Does that mean it is very likely to risk conflicts when installing svg.rb?
I'd love to have vectors from Inkscape imported, but I don't want to mess up my plugins...
-
Svg.rb is ok, but it loads set.rb.
Set.rb disables smoove from sandbox tools.
That`s it.
So I keep both svg.rb and set.rb away from plugins folder and move them back in only when needed. -
You could try this:
'disable'set.rb
by renaming itset.rb.txt
edit the file../Plugins/remxl/parsers/baseparser.rb
near the start disable therequire
forset
by prefixing the line with a#
, thus
**#**require 'set'
You should still get the required 'Set' functions loaded by Sketchup for the svg tool AND sandbox...Try it this way and report back - you should then get both tools working..........
-
@tig said:
You could try this:
'disable'set.rb
by renaming itset.rb.txt
edit the file../Plugins/remxl/parsers/baseparser.rb
near the start disable therequire
forset
by prefixing the line with a#
, thus
**#**require 'set'
You should still get the required 'Set' functions loaded by Sketchup for the svg tool AND sandbox...Try it this way and report back - you should then get both tools working..........
Before you follow the instructions:
After TIG instructions:
I have no knowledge of scripts, just follow the instructions.
Regards to all, and I hope someone helps us.
-
oh, oh, I'm a bit frightened But however, thanks for your efforts guys! Guess I'll be not diving into svg too soon, but sure remain interested...
cheers -
Looks like my idea isn't working as the SUp's
Set
has fewer methods thanset.rb
'sSet
... F
So forget what I said earlier - you can have eithersvg.rb
[withset.rb
] working OR theSandbox-Tools
[and any other tools using 'Set' methods]... But not both. You must choose. -
Any fix on that in the meantime?
Thanks. -
ζζ³θ¦θ―δΈδΈθ‘δΈθ‘
-
@rjh5945 said:
ζζ³θ¦θ―δΈδΈθ‘δΈθ‘
Really...
An English forum and you didn't even bother to use Google Translate or alike...?!?Please note that this plugin dates back to 2010...
I don't think you're going to make it work with newer versions of SketchUp...
Advertisement