Export sketch to DXF

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Murmele
Posts: 31
Joined: Sat Mar 11, 2017 1:24 pm

Export sketch to DXF

Post by Murmele »

Hi,

I have a sketch created from a step model I would like to export as DXF to import it into KiCad. Trying to import into KiCad I'm getting the error message "No graphic items found in file to import".
I opened the file in LibreCad and saw that the dxf does not consist simple lines which are moveable, but a complex part which I cannot modify, just moving as complete (When I'm creating a simple multiline sketch, in LibreCad I can move the single lines around without moving the others). This might be the reason KiCad is not able to open it because it's to complex.
Do anybody know why FreeCad exports the part as one and not each line separated?

I deleted in a second sketch (Sketch001) the most of the sketch out, because otherwise it is quite slow.

It is the Flatpak version:
OS: Linux 5.4.8-arch1-1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14555 (Git shallow)
Build type: Release
Branch: (HEAD detached at 0.18.4)
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 2.7.15
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
MBXL_RA_RCPT_2P24S2P.dxf
Exported dxf
(1.61 KiB) Downloaded 55 times
MBXL_RA_RCPT_2P24S2P.FCStd
(127.15 KiB) Downloaded 62 times
Murmele
Posts: 31
Joined: Sat Mar 11, 2017 1:24 pm

Re: Export sketch to DXF

Post by Murmele »

Is this a bug?
User avatar
Forthman
Veteran
Posts: 2669
Joined: Fri Apr 27, 2018 11:23 am
Location: Tarn-et-Garonne (82)

Re: Export sketch to DXF

Post by Forthman »

i select the sketch, ctrl+e (export)
and... it works
test.dxf
(38.4 KiB) Downloaded 161 times
Murmele
Posts: 31
Joined: Sat Mar 11, 2017 1:24 pm

Re: Export sketch to DXF

Post by Murmele »

Yes I'm able to export, but when opening in LibreCad it's a single part, not multiple lines. I'm not able to import into KiCad
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Export sketch to DXF

Post by wandererfan »

Murmele wrote: Wed Jan 15, 2020 4:11 pm I have a sketch created from a step model I would like to export as DXF to import it into KiCad. Trying to import into KiCad I'm getting the error message "No graphic items found in file to import".
Is this one any better? It seems to be individual lines in LibreCAD.
Attachments
mbxl_ra_rcpt.dxf
(54.81 KiB) Downloaded 54 times
User avatar
Forthman
Veteran
Posts: 2669
Joined: Fri Apr 27, 2018 11:23 am
Location: Tarn-et-Garonne (82)

Re: Export sketch to DXF

Post by Forthman »

otherwise you can use the command "explode" in librecad to... explode a block ;)
Murmele
Posts: 31
Joined: Sat Mar 11, 2017 1:24 pm

Re: Export sketch to DXF

Post by Murmele »

wandererfan wrote: Fri Jan 17, 2020 12:06 am
Murmele wrote: Wed Jan 15, 2020 4:11 pm I have a sketch created from a step model I would like to export as DXF to import it into KiCad. Trying to import into KiCad I'm getting the error message "No graphic items found in file to import".
Is this one any better? It seems to be individual lines in LibreCAD.
Hi wanderfan,

yes this is what I wanna have, thank you. This dxf I can open in KiCad too. How did you export it to have individual lines?


Forthman wrote: Fri Jan 17, 2020 6:11 am otherwise you can use the command "explode" in librecad to... explode a block ;)
Hi Forthman,
yes this works too, thank you!
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Export sketch to DXF

Post by wandererfan »

Murmele wrote: Fri Jan 17, 2020 4:33 pm yes this is what I wanna have, thank you. This dxf I can open in KiCad too. How did you export it to have individual lines?
There are 2 Dxf exporters - one in the Draft module ("Legacy python exporter") and one in the Import module. Sometimes one works better than the other.
In this case I used the one from the Import module. Just change the preference, then select the Sketch, then File>Export (AutoDesk Dxf).
Attachments
UseImportModule.png
UseImportModule.png (123.64 KiB) Viewed 7144 times
User avatar
Roy_043
Veteran
Posts: 8579
Joined: Thu Dec 27, 2018 12:28 pm

Re: Export sketch to DXF

Post by Roy_043 »

The OP is using V0.18 which does not have the 'Use legacy python exporter' option. So the OP would have to switch to V0.19.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Export sketch to DXF

Post by wandererfan »

Roy_043 wrote: Fri Jan 17, 2020 9:47 pm The OP is using V0.18 which does not have the 'Use legacy python exporter' option. So the OP would have to switch to V0.19.
In v0.18, make a TechDraw view of the sketch and use "export page as Dxf" or this in the python console:

Code: Select all

>>> import Import
>>> s = App.ActiveDocument.Sketch
>>> Import.writeDXFObject([s], "mbxlv18.dxf")
>>> 
Post Reply