• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Importing SVG

Scheduled Pinned Locked Moved Plugins
14 Posts 8 Posters 11.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    cloo
    last edited by 10 Jul 2010, 08:15

    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:

    http://gyazo.com/cb6b9a12e80a1f55bb998ab108614ccc.png

    Do you have an idea what`s the problem, and can anybody import SVG to sketchup at all?

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 10 Jul 2010, 08:57

      @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:

      http://gyazo.com/cb6b9a12e80a1f55bb998ab108614ccc.png

      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:
      @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 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 ! πŸ˜’
      πŸ€“

      PS: It also needs bezier.rb which you can get from here... http://sketchup.google.com/download/rubyscripts.html πŸ˜•

      TIG

      1 Reply Last reply Reply Quote 0
      • C Offline
        cloo
        last edited by 10 Jul 2010, 15:09

        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

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 10 Jul 2010, 15:23

          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.

          Hi

          1 Reply Last reply Reply Quote 0
          • C Offline
            cloo
            last edited by 10 Jul 2010, 15:47

            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.

            1 Reply Last reply Reply Quote 0
            • S Offline
              shura
              last edited by 10 Jul 2010, 21:28

              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...
              πŸ˜•

              1 Reply Last reply Reply Quote 0
              • C Offline
                cloo
                last edited by 11 Jul 2010, 09:11

                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.

                1 Reply Last reply Reply Quote 0
                • T Offline
                  TIG Moderator
                  last edited by 11 Jul 2010, 10:00

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

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • I Offline
                    ideas_arte
                    last edited by 11 Jul 2010, 21:51

                    @tig said:

                    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:
                    before

                    After TIG instructions:
                    After

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

                    Regards to all, and I hope someone helps us.

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      shura
                      last edited by 11 Jul 2010, 22:02

                      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

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        TIG Moderator
                        last edited by 12 Jul 2010, 08:05

                        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.

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • dereiD Offline
                          derei
                          last edited by 12 Oct 2011, 08:50

                          Any fix on that in the meantime?
                          Thanks.

                          DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                          1 Reply Last reply Reply Quote 0
                          • R Offline
                            rjh5945
                            last edited by 17 Dec 2017, 15:51

                            ζˆ‘ζƒ³θ¦θ―•δΈ€δΈ‹θ‘ŒδΈθ‘Œ

                            1 Reply Last reply Reply Quote 0
                            • FrederikF Offline
                              Frederik
                              last edited by 17 Dec 2017, 21:08

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

                              Cheers
                              Kim Frederik

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post
                              Buy SketchPlus
                              Buy SUbD
                              Buy WrapR
                              Buy eBook
                              Buy Modelur
                              Buy Vertex Tools
                              Buy SketchCuisine
                              Buy FormFonts

                              Advertisement