Skip to main content
Solved

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

  • September 4, 2015
  • 1 reply
  • 101 views

g_tz
Contributor
Forum|alt.badge.img+2
  • Contributor
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

Best answer by gio

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
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • September 4, 2015
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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings