Importing SVG

Importing SVG

Postby cloo » Sat Jul 10, 2010 9:15 am

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?
0

cloo 
 

Re: Importing SVG

Postby TIG » Sat Jul 10, 2010 9:57 am

cloo wrote: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 called rexml, inside that a folder called parsers and inside that a file called pullparser.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:
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 requires rexml: You will find the files in a standard ruby environment: Copy the rexml Folder to your Sketchup Plugins Folder.
You will also need the forwardable.rb and set.rb from ruby in your Plugins Folder.
You might think that the rexml 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 just rexml 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/
Capture.PNG
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 ! :roll:
:geek:

PS: It also needs bezier.rb which you can get from here... http://sketchup.google.com/download/rubyscripts.html :?
1
TIG
User avatar
TIG 
Global Moderator
 

Re: Importing SVG

Postby cloo » Sat Jul 10, 2010 4:09 pm

Thank you TIG! Life is much easier with folks like you. :thumb: .
I`ll try to give something in my turn, too.
Here is the plugin with all the needed scripts:
SVG import.zip
2

cloo 
 

Re: Importing SVG

Postby Jim » Sat Jul 10, 2010 4:23 pm

Just so you know, we've had this posted back in 2008 (but now removed)

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.
0
Hi

Jim 
Global Moderator
 

Re: Importing SVG

Postby cloo » Sat Jul 10, 2010 4:47 pm

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.
0

cloo 
 

Re: Importing SVG

Postby shura » Sat Jul 10, 2010 10:28 pm

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...
:?
0
User avatar
shura 
 

Re: Importing SVG

Postby cloo » Sun Jul 11, 2010 10:11 am

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.
0

cloo 
 

Re: Importing SVG

Postby TIG » Sun Jul 11, 2010 11:00 am

You could try this:
'disable' set.rb by renaming it set.rb.txt
edit the file ../Plugins/remxl/parsers/baseparser.rb
near the start disable the require for set 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..........
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Importing SVG

Postby ideas_arte » Sun Jul 11, 2010 10:51 pm

TIG wrote:You could try this:
'disable' set.rb by renaming it set.rb.txt
edit the file ../Plugins/remxl/parsers/baseparser.rb
near the start disable the require for set 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:
Captura de pantalla 2010-07-11 a las 11.59.39.png


After TIG instructions:
Captura de pantalla 2010-07-11 a las 12.07.29.png


I have no knowledge of scripts, just follow the instructions.

Regards to all, and I hope someone helps us.
0

ideas_arte 
 

Re: Importing SVG

Postby shura » Sun Jul 11, 2010 11:02 pm

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
0
User avatar
shura 
 

Re: Importing SVG

Postby TIG » Mon Jul 12, 2010 9:05 am

Looks like my idea isn't working as the SUp's Set has fewer methods than set.rb's Set ... F
So forget what I said earlier - you can have either svg.rb [with set.rb] working OR the Sandbox-Tools [and any other tools using 'Set' methods]... But not both. You must choose.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Importing SVG

Postby derei » Wed Oct 12, 2011 9:50 am

Any fix on that in the meantime?
Thanks.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: Importing SVG

Postby rjh5945 » Sun Dec 17, 2017 4:51 pm

我想要试一下行不行
-1

rjh5945 
 

Re: Importing SVG

Postby Frederik » Sun Dec 17, 2017 10:08 pm

rjh5945 wrote:我想要试一下行不行

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...
0
Cheers
Kim Frederik
User avatar
Frederik 
Thea Render Support
Thea Render Support
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: Google Bot, riisgaard and 15 guests

Visit our sponsors: