Inkscape is a great open program, that allows you to create & edit many types of vector files. What I found was that Inkscape had an issue with saving AutoCAD DXF files that will open in many, If not all cad programs. Being the type of person that can't leave well enough alone, & knowing that dxf files are really just simple text files that can be edited in any text editor, I set out to search the net with my trusty sidekick Google.
Now my goal is to get Inkscape to save a dxf file as a version 12 format. After looking at the modified Inkscape files over on bobcookdev.com , I had a good idea what needed to be done to get Inkscape exporting in R12 dxf format.
With the help of cnczone members, two sample files were tested to see If either dxf file had any issues, as of this blog post, no problems.
I have only tested this with Inkscape 0.46 on Windows XP.
Installation:
Now my goal is to get Inkscape to save a dxf file as a version 12 format. After looking at the modified Inkscape files over on bobcookdev.com , I had a good idea what needed to be done to get Inkscape exporting in R12 dxf format.
With the help of cnczone members, two sample files were tested to see If either dxf file had any issues, as of this blog post, no problems.
I have only tested this with Inkscape 0.46 on Windows XP.
Installation:
Download the zip file Inkscape_R12_Dxf.zip (4.51kb). It contains:
*******************************************************************
simpletransform.py (this replaces an existing file)
mydxf_templates.py
mydxf_outlines.inx
mydxf_outlines.py
*******************************************************************
Extract the four files and install them into ( C:\Program Files\Inkscape\share\extensions ) this should be the default path that Inkscape saves to when first installing Inkscape, then restart Inkscape to activate.
When you are ready to save a file in Inkscape, the new extension is DXF R12 (*.DXF) , listed in the "Save As..." window.
When you are ready to save a file in Inkscape, the new extension is DXF R12 (*.DXF) , listed in the "Save As..." window.
Free Inkscape training videos are available on my Inkscape video blog.
Free DXF Projects
November 10, 2008 at 11:45 PM
Works perfect. Output files open in Cut2D and Autocad 2004 no problem.
November 13, 2008 at 11:47 PM
Glad everything is working for you. :)
And thanks for posting what programs you tested your files with.
December 27, 2008 at 1:03 PM
Hi Switcher
Items traced in Inkscape open perfectly in CorelDraw X3 and cut perfectly when imported into AlphaCam. Thanks
Keelhauled
December 27, 2008 at 4:47 PM
Keelhauled,
Thanks for the info. on CorelDraw X3 & AlphaCam. :)
January 23, 2009 at 12:08 PM
Hi,
Would anyone have any idea how to do this with Inkscape 0.46 for os x? I'm not much of a programmer unfortunately... but as an architect this function would come in super handy. Thanks!
January 28, 2009 at 1:34 PM
Nick,
I don't run OS X,
I'll look into what's needed for OS X, I can't promise anything. as I only run Win XP.
January 30, 2009 at 6:53 AM
Hi Switcher,
Much appreciated, thank you.
January 31, 2009 at 1:49 PM
Hello,
Switcher, Thank you for the plugin, it works wonderfully on my Windows system. I understand that you run Windows, do you know of anyone who is using it on Linux?
I'm running into some trouble getting it working on Inkscape v0.46 under Ubuntu v8.04 LTS. I first tried installing in my user Inkscape extensions dir and received the following errors:
--------------------------------------------------------
Traceback (most recent call last):
File "/home/{UserName}/.inkscape/extensions mydxf_outlines.py", line 24, in (module)
import inkex, simplepath, simpletransform, cubicsuperpath, cspsubdiv, mydxf_templates, re
ImportError: No module named inkex
--------------------------------------------------------
*** NOTE that "(module)" was surrounded by "<" ">" chars but needed to be changed in order to post on the forum.
I worked around the error by moving the plugin files from "/home/{UserName}/.inkscape/extensions" into the main Inkscpae extensions dir "/usr/share/inkscape/extensions" Now I do not get any errors but the DXF file that gets saved is 0 byte.
Anyone using the plugin know of a fix for this?
Thanks in advance for any help!
February 2, 2009 at 6:43 PM
iam looking for a converter i scan in drawing and images that i make on my drawing board or i take a picture and trace it then i want to put in cad software and work on it ,can u help me
thanks mike c
February 2, 2009 at 7:10 PM
mike c,
Have a look at this video on my other blog, Inkscape + my dxfR12 plugin makes it really easy (after you convert a few images to dxf).
http://inkscapedxf.blogspot.com/2008/11/inkscape-convert-bitmap-to-dxf.html
.
April 1, 2009 at 11:17 PM
Great work, Switcher. Thanks for sharing. I've tried in on Acad2000 and it seems to be working fine.
Mike
April 1, 2009 at 11:20 PM
Mike,
Glad it's working for you.
Thanks for the info on Acad2000.
Switcher
May 13, 2009 at 12:17 PM
Hey Switcher,
Thanks for the convertor file for Inkscape. I guess I should try and learn the program now. You make it look so easy.
ericandmollie (cnczone)
May 13, 2009 at 12:43 PM
ericandmollie,
Actually, once you learn a few basic things in Inkscape it's really easy to work with.
Inkscape has a few quirks, but hey it's free. :)
Thanks for stopping by.
Switcher
July 17, 2009 at 6:15 AM
Hello,
is it possible to activate your extension from the command line?
Thanks.
Mattia.
July 17, 2009 at 6:48 AM
I received the following error while trying to convert an SVG to DXF usinf R12 DXF:
File "C:\...\share\extensions\mydxf_outlines.py", line 81, in effect
h = inkex.unittouu(self.document.getroot().xpath('@height',inkex.NSS)[0])
AttributeError: 'NoneType' object has no attribute 'getroot'
July 30, 2009 at 3:43 AM
Hi, thanks for this.
My original BMP has relatively thick lines which when I convert to import into SVG end up as two paths. (one for the "inner" edge of the line and one for the "thick" edge.)
Then when converting to .dxf I end up with two lines defining the inner and outer edge. whereas i want to just take the median point. does anyone know how i could do this in inkscape or illustrator.
September 25, 2009 at 3:28 PM
Dear sir,
I'm having problems instaling the R-12 plug in into Inkscape, I have Windows Vista, Could you walk me through the instalation process or E-Mail me at winstonsoccorro@gmail.com with a way to contact you.
Winston
September 25, 2009 at 6:03 PM
I only have Windows XP.
I did get some feedback from another user on the cnczone forum, that said they followed the instructions at the top of this page, & installed with no problems, on Vista.
You can also find more active users of this plugin at:
http://www.cnczone.com/forums/showpost.php?p=670605
Go to the newest post in that thread, towards the end of that thread.
I'm not sure what else I can say to get you running, that I havn't posted at the top of this page.
Thanks.
December 15, 2009 at 3:11 PM
I am interested in using the Rx12 plugin with Inkscape .047 but am concerned it may overwrite files such as simplytransform.py. Is this an issue or is it ok to use this plugin with .047
Thanks
Rick
December 15, 2009 at 3:23 PM
Does your DXF R12 Work with Vectrics VCarve?
Thanks
December 15, 2009 at 5:08 PM
RBRAGUE,
1) I've only tried this plugin with Inkscape 0.46
2) Yes, the dxf exported with this plugin works fine with Vectric "Vcarve Pro".
If you already have Vcarve Pro, you can use the .eps export inside Inkscape to create a .eps file, then import the .eps file to Vcarve Pro.
December 15, 2009 at 8:20 PM
Great - I like the EPS route -will do ...
Thanks
December 15, 2009 at 8:29 PM
Hmmm. Just tried the eps save as in Inkscape and then tried to import into VCARVE PRO and received message "Failed to import Vector data from EPS/AI/PDF-
Probably contains only bitmap data.
Any thoughts?
Thanks
Rick
December 16, 2009 at 8:46 AM
RBRAGUE,
If you are tracing an image inside Inkscape, make sure to delete the bitmap image, after the trace is complete.
The way Inkscape trace works is, once you click the apply button in the trace popup window, it will stack the new traced vector on top of the bitmap raster image.
So, move the new traced vector out of the way, & delete the raster image. When you delete the raster image, it will only be deleted from Inkscape, so you will still have a copy of the raster on your PC.
Vcarve Pro has no problem importing an Inkscape .eps file, I double checked on my own PC, before posting this comment.
Make sure you only have vector images, & no raster (.bmp, .jpg, .gif, etc...)
Hope this helps, :)
December 16, 2009 at 9:24 AM
Great Works like a charm-Thanks for all your help!!
December 16, 2009 at 11:01 AM
RBRAGUE,
Cool!
Glad that worked for you! :)
January 4, 2010 at 7:54 PM
Thanks for sharing your work, Switcher.
Inkscape 0.47 comes with a newer and larger simpletransform.py file. Have you tested your plugin with 0.47?
Regards,
Jeff
January 4, 2010 at 8:32 PM
lumberjack,
I havn't tried this plugin on 0.47, yet.
I'll have to take some time & do some testing, to see how things work. :)
Thanks,
January 18, 2010 at 3:52 PM
I tried it with Inkscape .47, fails because xpath() only wants one positional argument.
I tried replacing
self.document.getroot().xpath(path,inkex.NSS)
with
self.document.getroot().xpath(path, namespaces=inkex.NSS)
but although it isn't throwing an error, it isn't doing anything, either.
I can use .46 for now.
Thanks!!!
David Yerger
June 14, 2010 at 9:52 PM
I can not get it to work i have tried saving it in the new extension and it doesnt pop up in autocad or sheetcam
June 15, 2010 at 6:55 AM
Bobby,
Can you compress the dxf file, into a zip file? Then send the zip file to my email & I'll have a look at the dxf.
mydxf (AT) hotmail (dot) com
Thanks,
August 18, 2010 at 3:47 PM
Hi
I confirm that bug
R12 extension doesn't work in inkscape 0.47 (ubuntu 10.04)
October 11, 2010 at 12:08 PM
anything further with inkscape 0.47 on how to save as a r12 extension?
ron hess
October 11, 2010 at 2:13 PM
Ron,
This plugin works inside both Inkscape 0.46 & 0.47
I've tested both versions on the same PC & they are exporting R12 dxf files from the same plugin on this page (above).
Let me know If you need more help.
Thanks, Switcher
October 20, 2010 at 4:55 PM
Hey Switcher,
I've tried your method but it wasn't working for me (probably because I was doing something wrong). I downloaded v0.48 and it has a feature that I found works for me.
Open image in Inkscape
Go to PATH - Trace Bitmap
- play with the settings till it looks good
Save As Desktop Cutting Plotter (R13)(.dxf)
Doing this let me open .dxf in AutoCAD 2005 and my Torchmate CAD program.
March 4, 2011 at 10:17 AM
Switcher,
Tried my project using inkscape .47 and the beta version of cambam. Inkscape went rather well, but when i imported the dxf file into cambam i ran into two issues first the object had double lines instead of just a single. Then there was a message saying Line 2 unexpected entity 999 dxf r12 output. What should i do to correct these problems.
Ron Hess
March 4, 2011 at 10:15 PM
Send me the inkscape svg file & I'll have a look. switchermydxf[at]gmail[dot]com
Replace [at] and [dot] in the email link.
March 20, 2011 at 2:01 PM
First off, thank you for the extension!!!
To get this to work with Inkscape 0.48, I had to slightly modify the "mydxf_outlines.py" file.
Changed line 81 to:
h = inkex.unittouu(self.document.xpath('@height', namespaces=inkex.NSS)[0])
Changed line 84 to:
for node in self.document.xpath(path, namespaces=inkex.NSS):
The problem was the second parameter of the xpath method must be named ("namespaces").
After making the chance, I was able to save to DXF, but unfortunately I'm still not getting the results that I am looking for. I'd like for each path to be exported as a single polyline. Instead I get a bunch of individual lines that I have to go and manually convert. I need this for CNC engraving.
February 19, 2012 at 12:13 PM
Thanks Anonymous.
I'm also using version 0.48 and modifing that file made the job for me .
October 14, 2013 at 8:29 PM
excelente todo
Post a Comment