

For example here is a simple 1x2 rectangle I drew in SolidWorks and saved as DXF. When I say "other DXFs open fine in Inkscape" - I haven't tried a lot, but only simple drawings saved from SolidWorks. I'm afraid that Inkscape outputs the DXFs in reduced size and some underhood knowledge is needed to get it right. Those programs were Illustrator, a CAD (only a free demo) and Inkscape. When the DXF was imported to 3 separate programs with 100 scaling and having 1 unit 1 mm, all programs got 31,75 mm wide rectangle.


When I saved it as DXF, the base unit was selected to be 1 mm. Polyline, LWPolyline, etc), but always the same result. I made in Inkscape a strokeless 120 mm wide rectangle. I tried all sorts of combinations of options in KLayout's File > Save As. So Inkscape script can swallow Solidworks DXF, but chokes on KLayout's DXF - perhaps it's KLayout's different interpretation of some grey area in the DXF specification.

NameError: name 'layername' is not definedĮven though "dxf_input.py" is an Inkscape python script, that python script does work for a DXF file from SolidWorks. Other DXFs open fine in Inkscape (latest version), so I don't suspect it's an Inkscape problem, just a compatibility problem. * Why not draw it by hand? Because I need to script it. * Why not script it in Inkscape? Because I prefer the KLayout API. * Why involve Inkscape? Our laser cutter needs SVG, but KLayout only exports DXF. When you bring your file into TAP lab you can open it from Inkscape to send it to the laser cutter software.I'm scripting some shapes, drawing them on layer 1, saving as DXF via KLayout's GUI, then attempting to open in Inkscape to convert to SVG (for laser cutting).
