Importing SVG with layers?
Importing SVG with layers?
I have a SVG file that has layers in it. I can't figure out a way to import the SVG and it include the inherent layers. Is this possible?
- Adrian
- Vectric Archimage
- Posts: 14685
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Importing SVG with layers?
It's certainly possible as the attached file shows (unzip it to see the two files within). I would suspect whichever program you're using to create the SVG file isn't creating the file correctly.
- Attachments
-
- Layer Test.zip
- (1.66 KiB) Downloaded 19 times
- martin54
- Vectric Archimage
- Posts: 7355
- Joined: Fri Nov 09, 2012 2:12 pm
- Model of CNC Machine: Gerber 48, Triac PC, Isel fixed gantry
- Location: Kirkcaldy, Scotland
Re: Importing SVG with layers?
As Adrian has said it does work & the problem is often the software you are exporting from either not supporting layers when exported or it is not set up to support it. Have a look at the software you are exporting froms settings to see if it is something in their export filters that needs to be changed
Re: Importing SVG with layers?
Thank you Adrian! I was able to download your test files and import them with the layers. The file in question is one I purchased. I will follow up with the seller. Thank you!
Re: Importing SVG with layers?
So I went back to where I got the file from and they state that it is done in layers and even sent a screen shot (see attached PNG). I'm also attaching the SVG file (zipped) that's in question and was wondering if someone else could import it and see if they see the layers, because I can't for the life of me see the supposed inherent layers.
Many thanks in advance
Many thanks in advance
- Attachments
-
- 4th2-01.zip
- Zipped SVG file
- (4.4 KiB) Downloaded 24 times
- Adrian
- Vectric Archimage
- Posts: 14685
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Importing SVG with layers?
There aren't any named layers in that file. I can see from it that is was created with Illustrator. Perhaps they didn't set up the Object Id to Layer name relationship when exporting or maybe they didn't name the layers at all as I can't see any layer names in that screenshot.
- adze_cnc
- Vectric Wizard
- Posts: 4380
- Joined: Sat Jul 27, 2013 10:08 pm
- Model of CNC Machine: AXYZ 4008
- Location: Vancouver, BC, Canada
Re: Importing SVG with layers?
Bringing the SVG into Illustrator shows that it does have a layer named “Layer 1”:
and looking at the SVG in a text editor verifies that:
Your screenshot showing that “it is done in layers” shows what the Illustrator screenshot above shows. One layer with elements (groups and paths in Illustrator) as sub-branches of that layer.
By the way if the following is true of the SVG posted above;
and looking at the SVG in a text editor verifies that:
Your screenshot showing that “it is done in layers” shows what the Illustrator screenshot above shows. One layer with elements (groups and paths in Illustrator) as sub-branches of that layer.
By the way if the following is true of the SVG posted above;
Then you really shouldn’t have posted it here as it is someone else’s intellectual property.The file in question is one I purchased.
- Adrian
- Vectric Archimage
- Posts: 14685
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Importing SVG with layers?
What I meant was multiple layers which is what the OP is expecting. For layers to show up in the SVG import each one needs to have an id on the <g> section.
Code: Select all
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<g id="Layer1">
<rect x="10" y="10" width="80" height="80" fill="red" />
</g>
<g id="Layer2">
<polygon points="50,5 25,95 95,40 5,40 75,95" fill="yellow" />
</g>
<g id="Layer3">
<polygon points="50,5 95,30 80,85 20,85 5,30" fill="green" />
</g>
</svg>