Cannot 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!
chris s
Posts: 21
Joined: Mon Mar 06, 2017 1:23 pm

Cannot export sketch to DXF

Post by chris s »

I am using Freecad 0.18 and I have checked the import/export dxf box that enables it to automatically download the DXF libraries.
Problem is when I then select to export a sketch it says techdraw module does not support that object type.
What am I doing wrong?
User avatar
Roy_043
Veteran
Posts: 8455
Joined: Thu Dec 27, 2018 12:28 pm

Re: Cannot export sketch to DXF

Post by Roy_043 »

chris s
Posts: 21
Joined: Mon Mar 06, 2017 1:23 pm

Re: Cannot export sketch to DXF

Post by chris s »

I have not created an object, I have just used Freecad to create a 2d sketch which needs to be in DXF format.
Do I have to dreate an object?
User avatar
Roy_043
Veteran
Posts: 8455
Joined: Thu Dec 27, 2018 12:28 pm

Re: Cannot export sketch to DXF

Post by Roy_043 »

If you align the view with your sketch and check the "Project exported objects along current view direction" exporting to DXF should work.
If not: post your file.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Cannot export sketch to DXF

Post by wandererfan »

chris s wrote: Sun Dec 22, 2019 3:22 pm I have not created an object, I have just used Freecad to create a 2d sketch which needs to be in DXF format.
Do I have to dreate an object?
Sounds like you are asking to export a "Technical Drawing".
typeOfFileTD.png
typeOfFileTD.png (57.44 KiB) Viewed 3393 times
You want to pick "Autodesk Dxf".
typeOfFile.png
typeOfFile.png (56.44 KiB) Viewed 3393 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Cannot export sketch to DXF

Post by vocx »

chris s wrote: Sun Dec 22, 2019 2:57 pm ...
What am I doing wrong?
You have to explain each step that you are doing.

1. First open FreeCAD
2. Select the Sketcher Workbench.
3. Draw a sketch.
4. Select the Sketch, and use TechDraw NewView.
...
etc.

You need to describe your problem with all details. Otherwise people trying to help you can only guess what steps you are taking.

Also, see Std_About.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chris s
Posts: 21
Joined: Mon Mar 06, 2017 1:23 pm

Re: Cannot export sketch to DXF

Post by chris s »

I have a sketch on my tree which I select then file export, all the dxf options.

I now get an error message Export failed, invalid syntax dxfreader.py line 88

This happens both in sketcher workbench and techdraw.

Do I need to post you my file?
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Cannot export sketch to DXF

Post by easyw-fc »

chris s wrote: Mon Dec 23, 2019 2:43 pm I now get an error message Export failed, invalid syntax dxfreader.py line 88

This happens both in sketcher workbench and techdraw.

Do I need to post you my file?
That's it!
You need to update your dxf library through Addons manager
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Cannot export sketch to DXF

Post by wandererfan »

chris s wrote: Mon Dec 23, 2019 2:43 pm I have a sketch on my tree which I select then file export, all the dxf options.
I now get an error message Export failed, invalid syntax dxfreader.py line 88
This happens both in sketcher workbench and techdraw.
Do I need to post you my file?
Post your file. You'll get better answers and get them quicker.

TechDraw only exports drawing pages. If you're trying to export the Sketch directly, TD won't help.

Selecting a sketch in the tree, then File>Export> "AutoDesk Svg" works here.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Cannot export sketch to DXF

Post by Syres »

This is a long outstanding bug that still applies today for users upgrading from 0.16 to either 0.18 or 0.19. I've just tested the procedure on Windows and can confirm the bug still exists. I'll put a PR in for each branch as the importDXF.py has changed significantly over the past few months.

Edit: Two PR's logged https://github.com/FreeCAD/FreeCAD/pull/2813 and https://github.com/FreeCAD/FreeCAD/pull/2814
Post Reply