Jump to content

Recommended Posts

Hello,

my new plugin to get SVG files out of Vectorworks is in beta testing.

 

Let me know if you are interested, as soon as I am ready the plugin will be placed on my Gumroad® page, at a reasonable price.

 

With this menu command you'll be able to export your Vectorworks elements (such as polylines, polygons, rects, arcs etc.) objects to an SVG file suitable for CNC machines.

All you have to do is select the objects to export and select the menu "Export selection to SVG", then choose a file name and click OK.

 

The program will produce the correct SVG code to replicate the same selected object in the SVG viewbox determined by the Vectorworks active layer drawing size.

Object are exported relatively to the active layer scale, so, if you need them for CNC purposes, better set the layer scale to 1:1 before exporting.

 

 

What Export selection to SVG can do:
The plugin CAN export the following Vectorworks objects:

  • Lines
  • Rects
  • Rounded rects
  • Arcs / circles
  • Ellipses
  • Polygons
  • Polylines (also with holes)

 

The plugin CANNOT export all the other types that are not included in the above types such as:

  • Groups, Symbols, Plugin objects (unless converted in the above types)
  • 3D objects
  • Texts (unless converted to polylines)
  • Quotes
  • Images

 

Attributes:
The SVG produced will preserve the following object attributes:

  • Solid fills
  • Solid strokes
  • Fill and stroke colors

The plugin does not consider dashes, gradients, textures etc..
 

Edited by Paolo
Adding specification
  • Love 1
Link to comment

Paolo,

This is very interesting.

Comment, you say that texts cannot be exported to SVG, and that is common to a great many SVG export options, for obvious reasons. But in most cases I have run across, if you select the text and apply Toolbar: Text / Convert Text to Polylines you can get excellent results. 

 

 

Link to comment

@Brian(J), I know, of course, just forgotten to mention it in the post (edited!)

Convert a text to path and you get a polyline (or a group of polylines).

Ungroup, if needed, and you are ready to export in SVG.

 

This is just the first version. I will add the text support either as direct text tag in the SVG or advising the user about the conversion to path (copying and converting it on the fly, leaving the actual text untouched).

Edited by Paolo
Link to comment

The plugin is now in an advanced testing phase (it is ready, almost).

I just want it to be perfect, more or less 😉

 

Please follow this post to know the release announce.

 

As promised in my previous reply, I have added the support for texts.

Texts that are included in the selection to export, are sent to the SVG as paths.

No need for the user to convert them into polylines. All is done inside the plugin process.

  • Love 1
Link to comment

Here's a couple of SVG produced with the Export selection to SVG command.

Feel free to test it in your workflow, I'd like to have your feedback before to release.

 

geometry test.svg

lines test.svg

 

and here's a part of the produced SVG code:

 

geometry text.svg

<?xml version="1.0" encoding="utf-8"?>

<!-- Generator: SVG Export Plug-In © Paolo Marcuccetti 2020. SVG Version: 20201128)  -->

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Level 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0" width="595.2px" height="841.68px"
viewBox="0 0 595.2 841.68"
xml:space="preserve">

<g transform="scale(28.346456692913385 -28.346456692913385)
translate(10.498666666666667 -14.8463)">
<rect x="-8.498666666666667" y="7.995558273480356" width="4.850741726519645" height="4.850741726519644"  fill="rgb(204, 204, 204)"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="2.016"  stroke="rgb(221, 9, 7)" />
<rect x="-2.425370863259822" y="7.995558273480356" width="4.850741726519645" height="4.850741726519644" rx="1.0" ry="1.0"  fill="rgb(204, 204, 204)"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="2.016"  stroke="rgb(221, 9, 7)" />
<path  fill="rgb(204, 204, 204)"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="2.016"  stroke="rgb(221, 9, 7)"  d=
"M8.498666666666667 11.425550642086936  7.077917308753603 12.8463  5.068674298060086 12.8463  3.6479249401470226 11.425550642086938  3.6479249401470226 9.416307631393419  5.068674298060084 7.995558273480356  7.077917308753605 7.995558273480356  8.498666666666665 9.416307631393417  Z
"/>
<circle cx="-5.924629136740178" cy="3.570187410220533" r="2.4253708632598228"  fill="rgb(204, 204, 204)"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="2.016"  stroke="rgb(221, 9, 7)" />
<path  fill="rgb(204, 204, 204)"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="2.016"  stroke="rgb(221, 9, 7)"  d=
"M2.4253708632598228 2.746332281802734  -0.6412188019392882 2.746332281802734  -0.6412188019392879 4.394042538638335  2.4253708632598228 4.394042538638335  2.4253708632598228 5.995558273480356  -2.425370863259822 5.995558273480356  -2.4253708632598214 1.1448165469607112  2.4253708632598228 1.144816546960712  Z
"/>
<path  fill="rgb(204, 204, 204)"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="2.016"  stroke="rgb(221, 9, 7)"  fill-rule="evenodd" d=
"M5.078295803406844 2.5751874102205337  5.078295803406844 4.565187410220534  7.068295803406845 4.565187410220534  7.068295803406845 2.5751874102205337  Z
M8.498666666666665 3.5701874102205333
A2.425370863259822 2.425370863259822 10313.240312354817 0 1 3.6479249401470213 3.5701874102205347
L3.6479249401470213 3.5701874102205333
A2.425370863259822 2.425370863259822 10313.240312354817 0 1 8.498666666666665 3.5701874102205324
 Z
"/>
<line x1="-8.498666666666669" y1="-12.206080187949256" x2="8.498666666666669" y2="-12.206080187949256"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="1.2959999999999998"  stroke="rgb(119, 119, 119)" />
<line x1="-8.498666666666669" y1="-12.8463" x2="8.498666666666669" y2="-12.8463"  vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-width="1.44"  stroke="rgb(119, 119, 119)" />
</g>
</svg>

 

Edited by Paolo
Message too much long!
Link to comment

Here is more detail. I ungrouped the drawing and tried loading/cutting each individual element. The first two rows and the lines at the bottom are great. The truncated circle and the letters A B C, the entire row 3, will not place in any combination or alone. The truncated circle has an additional element, a sort of shadow, hidden behind it, but removing it does not help either.

 

I think you are close to something good here.

Edited by Brian(J)
Link to comment

Thank you @Brian(J) for your test.

 

Objects come grouped, this is necessary due to the transformation (scale(1,-1)) needed to flip the Y axis that is reversed in Vectorworks.

This is needed, there is no other way to flip Y, as far as I know.

 

About the truncated circle, this is a very special case where you cannot get the same (partially stroke in Vectorworks) circle in SVG unless you draw a truncated circle (really is a polyline) for the fill and an arc for the stroke.

 

About the letters, they should be polylines, maybe the problem is that they have no stroke and your program does not recognise it?

 

This should not a be a problem.

From a graphical point it is correct that there is no stroke (as they appear in Vectorworks!) but if you need strokes, anyway, I'll do in way to propose stroke as option.

 

I have also changed the SVG version

<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"

since I use the attribute 

vector-effect="non-scaling-stroke"

that is available from this version (1.2 Tiny).

However this attribute is already present in most SVG implementations, but it may be not the case of Shaper, that does not recognise the code.
I have tried with an online validator this new version and it passes the test correctly.

 

This attribute is used to get the the visually balanced line weight independently from view zoom, but it does not alter the real weight (that is, if you open the exported file in Illustrator, you get the same line weight that in Vectorworks), so I can simply decide to omit this attribute, if it 'd be a problem.

 

I have uploaded the updated version of the two tests, please, give them a try, if you can.

 

geometry test.svg

lines test.svg

 

Link to comment

Thank you @Brian(J) for your prompt reply.

Here's a file with just three rows of converted text

 

text with stroke test.svg

 

When the program finds a "text" type in the selection, it shows this dialog:93834418_Schermata2020-12-03alle16_45_19.thumb.png.4cc13223879544fe459f448cfd4ef297.png

If you include strokes, they will be 1pt with the same color as fill.

 

Thank you to get in touch with Shaper.

I have browsed their site and downloaded their Illustrator template to compare with mine.

No differences (they use SVG 1.1 as in my previous tests), rather my code is more simple and clean, since I want it to be widely compatible.

Hope they give some tracks, though.

Link to comment

Paolo, the text files continue to fail. I have made 2 files and request you convert them to SVG with your plugin.

They have been set up with the correct color coding for cutting. The first has text and the second has text that has already been converted to polylines.

I also tried to attach an SVG file but that is not a listed allowable file type and it refused. Not sure how you are able to attach SVG's.

PolyTEST.vwx textTEST.vwx

Link to comment

Paolo

I could not get any of the files you sent to work. Attached are SVG files that do work. I have two ways of getting to an SVG from VW. 

First way is DXF to Fusion360 then export with the Shaper plugin. The files below 'Prandina exact' and 'Shaper Exported Geometry' were made that way.

Second way is to export PDF from VW to Inkscape then save as file type SVG (Not InkscapeSVG). "Prandina 2' was made using the PDF/Inkscape method.

 

The results are very different but both work. The resulting files are OK, but not as good as I would like. I think your plugin will be much better when it is finished.

Prandina 2.zip Prandina exact.zip Shaper Exported Geometry File.zip

Edited by Brian(J)
Link to comment

@Brian(J) this is my attempt:

prandina.svg.zip

 

Substantially, I have copied the header:

<?xml version="1.0" encoding="utf-8"?>

<!-- Generator: SVG Export Plug-In © Paolo Marcuccetti 2020. SVG Version: 20201206  -->

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Level_1"
x="0px" y="0px" width="558.96px" height="782.8799999999999px"
enable-background="new 0 0 558.96 782.8799999999999"
viewBox="0 0 558.96 782.8799999999999"
xml:space="preserve"
xmlns="http://www.w3.org/2000/svg"
xmlns:shaper="http://www.shapertools.com/namespaces/shaper"
xmlns:xlink="http://www.w3.org/1999/xlink">

and inserted a "," comma between x and y coordinates of the various path vertexes (as seen in your examples).

I hope this work.

Since I do not know what are Shaper SVG specific rules, I cannot go further chasing a (particular) solution by attempts, with the risk of losing the general compatibility.

Edited by Paolo
Link to comment

Hi Paolo,

Thank you for your efforts. With the very first examples you sent most of the shapes worked fine, and I think you could consider reverting back to that format if you have added code that might not be required. I think you should complete the plugin and when I have it installed I think I can make it work.

 

Looking forward to the final product.

Link to comment

@Brian(J) I am preparing a Beta version for you (and all) to download and try.

I will post the download link asap.

 

P.S.:

the SVG code in my files has not changed since earlier versions. Usually SVG readers    are very tolerant. I am the author of the SVG import plugin that is included in the Vectorworks italian version and I can assure you that there are, out there, so many ways of how the svg are listing their numerical values (with or without commas, spaces, carriage returns etc.) and it seems to me strange that Shaper cannot read a simple SVG 1.1 file that passes the official Mozilla consortium validation.

I have seen that the SVG exported with the Fusion plugin adds specific code that Shaper uses, but this should be obtained also interpreting the colors and fills suggested in their templates.

Link to comment

Paolo,

I have been using VW from I think 1986 (it was MiniCad 2 at that time) but have never before installed a plugin. I extracted to widows file path:

  C:\Program Files\Vectorworks 2020\Plug-Ins

then restarted VW. Can you describe or point me to a description of the next steps?

 

Thanks

 

Link to comment

@Brian(J) 

here's the instructions (from the site)...

 

Unpacking the downloaded zip file, you'll find a sole element:

Export to SVG.vsm

  1. Move the “Export to SVG.vsm” file inside your Vectorworks Plug-ins folder (in your case C:\Program Files\Vectorworks 2020\Plug-Ins).
  2. Restart Vectorworks.
  3. Edit your workspace adding the menu Export to SVG command (you'll find it in Import/Export category)
  4. Usually you'll add it in the File menu, Export submenu.
  5. Save the workspace.
  6. In the end you should get a new menu item Export to SVG in the File -> Export submenu.

Here instructions for editing the workspaces:

https://app-help.vectorworks.net/2020/eng/VW2020_Guide/Start/Customizing_workspaces.htm

 

And here instructions to add a menu command:

https://app-help.vectorworks.net/2020/eng/VW2020_Guide/Start/Modifying_menus_and_commands.htm#XREF_12039_Modifying_Menus

 

Note: the plugin is written in VW2021, however your 2020 should get it to work.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...