Thank you for the detailed description of a challenging process. I wouldn't have the patience any more.
The 393 is the inverse of 254 (mm/in mod 10) so it appears that something somewhere thought there were imperial units in use. I would guess that 1.0 (or decimal multiples thereof) 254 (and decimal multiples thereof) and 393 (and, yes, decimal multiples thereof) will be the only converson factors needed. HTH, Donald. ----- Original Message ----- From: "Robert" <[email protected]> To: [email protected] Sent: Thursday, December 17, 2009 1:43:50 PM GMT -05:00 US/Canada Eastern Subject: [kicad-users] DXF Import There have been a few questions on this recently. Since I've just had to do this myself and it wasn't exactly a smooth process, I thought it might be useful to document what I did. The following applies to 32 bit Windows, but I used open source software as far as possible so it does have some relevance to Linux. For 64 bit Windows you need 64 bit Python packages, but otherwise it should be relevant. The AutoCAD DWG files with which I was supplied were of a version that I couldn't do anything with, so I read them in using LX-Viewer (http://lx-viewer.sourceforge.net/) and exported them in AutoCAD version 12 format. This version was readable by all subsequent packages. Unfortunately the original drawings contained elements that gave the import into Kicad process a few problems (and in any case there was more detail in them than I required), so I had to edit them using my ancient copy of AutoCAD LT. If you need to do the same and don't have AutoCAD, you can use LX-Viewer to convert a DWG file to DXF if necessary, and you can probably import DXF into another editor (anyone care to recommend an open source AutoCAD replacement?). LX-Viewer will also export SVG files (along with some bitmap formats), but I only used DWG and DXF. For the import to work, the following element types only may be used: LINE, POLYLINE, LWPOLYLINE, ARC, CIRCLE, TEXT, MTEXT. Having edited the drawing as required (including replacing unsupported elements), I created my DXF file directly from AutoCAD. Import into Kicad is achieved using TTConv; there's a link to it from the Kicad homepage on Sourceforge (http://kicad.sourceforge.net/wiki/index.php/Main_Page). The TTConv page is in Italian, and the packages I downloaded using the instructions didn't want to play together. When you download TTConv you will get a zip file full of Python files. To run these you need to download and install the following Python packages in the following order: python-2.5.1.msi (http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi) PIL-1.1.6.win32-py2.5.exe http://code.google.com/p/pygraphics/downloads/detail?name=PIL-1.1.6.win32-py2.5.exe&can=2&q= wxPython2.8-win32-ansi-2.8.10.1-py25.exe (http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-ansi-2.8.10.1-py25.exe) Once you've installed this lot, you should be able to double-click on TTConv0.2.py and TTConv will run. Select Kicad...Dxf2Kicad from the menu and a window will appear with a few simple controls. Exporting as a Kicad library worked best for me (no risk of destroying one's PCB design). The controls are very straightforward except for the Scale unit DXF>Kicad box. I had to change this from the default of 100 to 393. The drawing units in the original files were metric, and I use Kicad in metric, so where 393 comes from I've no idea. If 393 doesn't work for you, choose the default, import into Kicad, and work out out far wrong it was as a scaling fraction. Then go back and modify the Scale unit by that fraction. So you must have at least one element of known dimensions to use as a convenient reference (in my case it was the board edge). Having finally created a module in a library, I then added the new library to my Kicad project. I found that the module (which is called TEST) was nowhere near the anchor, so I just moved it back into position and saved the footprint with a more meaningful name. That done I was able to insert it into my PCB as a module. There were a few lines missing from the imported graphics, but mostly it worked and what I ended up with was more than good enough. I hope this is helpful. Regards, Robert.
