Solved

How do I convert dwg to svg while maintaining style information (line / fill colors and line widths)?

  • 4 September 2015
  • 1 reply
  • 23 views

Hello all,

 

 

FME (and Autocad) noob here.

 

 

I am trying to convert a few thousand small DWG files to SVG. This works well with the Real DWG reader and SVG writer; however, I am having difficulty finding a way to set the SVG line width and polygon fill colors from the respective autocad format attributes. Any way I can achieve this without manually writing SVG-tags?

 

 

Cheers

 

Götz
icon

Best answer by gio 4 September 2015, 17:07

View original

1 reply

Badge +3
i think u have to write it into the style format parameter in the writer.

 

 

 

U can check incscape formatting by opening the xml editor in incscape, if you select an object and expand its tree in the xml-editor you can see the required format.

 

 

for example:

 

 

fill:none;stroke:#c40000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:40,5;stroke-dashoffset:0;marker-start:url(#Arrow1Lstart);marker-mid:url(#DotL);marker-end:url(#Arrow1Lend)

 

 

 

You can use fme to construct the style string using the autocad format attributes.

 

 

colors are hex i believe like in the example  stroke:#c40000

Reply