Skip to main content
Known Participant
March 17, 2017
Question

SVG export suffixing layer names with '_1_'

  • March 17, 2017
  • 1 reply
  • 2821 views

As per SVG export _1_

When copying a layer to the clipboard the ID for a layers name is suffixed with '_1_' in the SVG code. In the snippet below my layer is called 'layerName' but the copied SVG labels it 'layerName_1_'.

<rect id="layerName_1_" x="0.5" y="0.5" style="&st0;" width="130.6" height="72.7"/>

If I 'Save As' .svg the same file and open up the 'SVG Code...' panel available during export the code looks correct?

<rect id="layerName" x="123.6" y="127.3" style="&st0;" width="130.6" height="72.7"/>

Bug?

Thanks,
Chris

This topic has been closed for replies.

1 reply

Monika Gause
Community Expert
Community Expert
March 17, 2017

Please tell us step by step:

- what you have

- what you're doing

- what you expect to happen

Your version and system

In Illustrator you can't copy a layer. You can only copy an object.

Known Participant
March 17, 2017

Hi Monica,

Sorry, layer = object. When you copy an object the svg code gives you the objects name as per the examples I've provided.

Create a rectangle

Name it 'rectangle'

Copy it to your clipboard

Paste it into a text editor

Within that code you should see > rect id="rectangle_1_"

If I 'Save As' .svg the same file and open up the 'SVG Code...' panel available during export the code looks like > rect id="rectangle"

My question is where is the _1_ coming from via the copy/paste method?

We develop a tool in Autodesk Maya that allows you to copy/paste svg files into a 3d scene. We take the objects name from this code so this seemingly extraneous '_1_' appears suffixed to the name. We can't filter it out because someone may name an object _1_ intentionally.

Thanks,
Chris

Monika Gause
Community Expert
Community Expert
March 17, 2017

Thank you for the explantion.

To me this looks like Illustrator considers the copy to clipboard operation as a duplicate of the object and treats this like it treats objects when the XML-ID option is checked in Preferences > Units.

I don't know if this is a bug. Since you're developing a plugin/tool, why not try and discuss this in the SDK community. Maybe someone there has faced it as well Illustrator SDK