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

Postby chris s » Sun Dec 22, 2019 2:57 pm

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?
Roy_043
Posts: 716
Joined: Thu Dec 27, 2018 12:28 pm

Re: Cannot export sketch to DXF

Postby Roy_043 » Sun Dec 22, 2019 3:13 pm

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

Re: Cannot export sketch to DXF

Postby chris s » 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?
Roy_043
Posts: 716
Joined: Thu Dec 27, 2018 12:28 pm

Re: Cannot export sketch to DXF

Postby Roy_043 » Sun Dec 22, 2019 3:27 pm

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
Posts: 3482
Joined: Tue Nov 06, 2012 5:42 pm

Re: Cannot export sketch to DXF

Postby wandererfan » Sun Dec 22, 2019 7:47 pm

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 274 times
You want to pick "Autodesk Dxf".
typeOfFile.png
typeOfFile.png (56.44 KiB) Viewed 274 times
vocx
Posts: 2819
Joined: Thu Oct 18, 2018 9:18 pm

Re: Cannot export sketch to DXF

Postby vocx » Mon Dec 23, 2019 1:08 am

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.
To support the documentation effort, and code development, your donation is appreciated: paypal.
chris s
Posts: 21
Joined: Mon Mar 06, 2017 1:23 pm

Re: Cannot export sketch to DXF

Postby chris s » 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?
User avatar
easyw-fc
Posts: 2773
Joined: Thu Jul 09, 2015 9:34 am

Re: Cannot export sketch to DXF

Postby easyw-fc » Mon Dec 23, 2019 2:49 pm

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
Posts: 3482
Joined: Tue Nov 06, 2012 5:42 pm

Re: Cannot export sketch to DXF

Postby wandererfan » Mon Dec 23, 2019 2:56 pm

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
Posts: 441
Joined: Thu Aug 09, 2018 11:14 am

Re: Cannot export sketch to DXF

Postby Syres » Mon Dec 23, 2019 4:09 pm

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