Annotating lines at Dxf

Discussions about the development of the TechDraw workbench
manos
Posts: 264
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Annotating lines at Dxf

Post by manos »

ragohix769 wrote: Sat Jun 25, 2022 12:46 pm ..You can, as a partial workaround, export in SVG, there it's working percfectly. DXF it's not a really good interchange format, as I understand.
Unfortunately my LaserCutter only accepts the following formats: dwg, dxf. cdr, ai, top, step

Thanks anyway.
manos
Posts: 264
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Annotating lines at Dxf

Post by manos »

wandererfan wrote: Sat Jun 25, 2022 3:38 pm
manos wrote: Fri Jun 24, 2022 10:13 pm Does anybody know if it is possible to have annotating lines from TechDraw page to the Dxf ?
The export page command in TechDraw only supports DrawViewPart and DrawViewDimension. The exporter in the Import module can handle text - this is used for the dimension text.
At page005 we can see the "---------abc" line. I would be the happiest person off the globe if that line should has been transferred at Dxf as is: with the slope of 45 degrees. But as you can see at the screenshot it is horizontal...

"We live at the valley of Laments" Euripides. 5th century BC
Attachments
Screenshot from 2022-06-25 19-20-19.png
Screenshot from 2022-06-25 19-20-19.png (133.26 KiB) Viewed 456 times
0.20.test61d.dxf
(7.72 KiB) Downloaded 1 time
0.20 TEST2.FCStd
(104.46 KiB) Downloaded 3 times
User avatar
Roy_043
Veteran
Posts: 5232
Joined: Thu Dec 27, 2018 12:28 pm

Re: Annotating lines at Dxf

Post by Roy_043 »

manos wrote: Sat Jun 25, 2022 4:00 pm Unfortunately my LaserCutter only accepts the following formats: dwg, dxf. cdr, ai, top, step
Does your lasercutter need annotation in the DXF? I imagine that they are only interested in contours. Adding linework that is not part of a contour may actually be undesirable. It may confuse the software they use.
User avatar
ragohix769
Posts: 445
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Annotating lines at Dxf

Post by ragohix769 »

Roy_043 wrote: Sun Jun 26, 2022 10:54 am
manos wrote: Sat Jun 25, 2022 4:00 pm Unfortunately my LaserCutter only accepts the following formats: dwg, dxf. cdr, ai, top, step
Does your lasercutter need annotation in the DXF? I imagine that they are only interested in contours. Adding linework that is not part of the contour may actually be undesirable. It may confuse the software they use.
I agree. If the Lasercutter accept even *.ai files, that are a proprietary standard by Adobe, that it's essentially, I presume, vector based, the limitation is in the SW of the Lasercutter, because with a simple vector SVG it's perfect to say something about a laser contour cut. Are you really sure that your Lasercutter don't accept standard SVGs?

Anyway it remain the problem of sending annotated 2D source projects to others that are not using FreeCAD, because *.DXF, right now, as said, it's not a good interchange format to get these information (annotation) rather then basic geometry lines.
User avatar
wandererfan
Veteran
Posts: 4766
Joined: Tue Nov 06, 2012 5:42 pm

Re: Annotating lines at Dxf

Post by wandererfan »

manos wrote: Fri Jun 24, 2022 10:13 pm Does anybody know if it is possible to have annotating lines from TechDraw page to the Dxf ?
If your end goal is to produce Dxf files to drive a laser cutter, I'm not sure FreeCAD is the right tool for the job. There are many available tools that specialize in making Dxf files.
manos
Posts: 264
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Annotating lines at Dxf

Post by manos »

wandererfan wrote: Sun Jun 26, 2022 2:00 pm If your end goal is to produce Dxf files to drive a laser cutter, I'm not sure FreeCAD is the right tool for the job. There are many available tools that specialize in making Dxf files.
Wanderefan thanks for your help. The point is that I can do anything I need with FC , TechDraw. Then using TechDraw-> Export to Dxf and I export everything fine at Dxf except for a sloped line. If a line has a slope e.g. 49 degrees it will be exported to Dxf always as an horizontal line.

Please see the https://forum.freecadweb.org/viewtopic. ... 42#p605242

Thanks in advance

Code: Select all

OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * Help 1.0.3
Attachments
0.20 TEST2.FCStd
(104.5 KiB) Downloaded 2 times
manos
Posts: 264
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Annotating lines at Dxf

Post by manos »

ragohix769 wrote: Sun Jun 26, 2022 11:18 am ..Are you really sure that your Lasercutter don't accept standard SVGs?
ragohix769 thanks. I will ask tomorrow Monday first thing .
Workshop_Notes
Posts: 67
Joined: Wed Sep 29, 2021 8:35 am

Re: Annotating lines at Dxf

Post by Workshop_Notes »

manos wrote: Sun Jun 26, 2022 4:44 pm If a line has a slope e.g. 49 degrees it will be exported to Dxf always as an horizontal line.
It is not much help, especially if you actually need a line segment, but could you put two point objects on the drawing such that the line joining them has a slope of 49 dungarees?

Alternatively, use Ezdxf and a bit of Python to add the 49-degree line entity to the dxf file after it pops out from FC. Someone a lot smarter than I might even be able to do this with a macro from within FC.
manos
Posts: 264
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Annotating lines at Dxf

Post by manos »

Workshop_Notes wrote: Sun Jun 26, 2022 6:11 pm ..Alternatively, use Ezdxf and a bit of Python to add the 49-degree line entity to the dxf file after it pops out from FC...
Workshop_Notes thanks for the tip but I do not know Puthon. I am experienced programmer in Visual Basic etc.
Workshop_Notes
Posts: 67
Joined: Wed Sep 29, 2021 8:35 am

Re: Annotating lines at Dxf

Post by Workshop_Notes »

manos wrote: Sun Jun 26, 2022 7:12 pm I am experienced programmer in Visual Basic etc.
That's even better.

A dxf file is a text file. Its format is available here https://images.autodesk.com/adsk/files/ ... ce_enu.pdf

On pages 228 onwards of the document, there are example VB programs for reading and writing dxfs. For inserting a single line entity, I would use a simple text editor. On page 101-102 are the group codes for a line entity. You only need 10, 20, 11 and 21 for a 2D line.

Create a really simple sketch within FC that is a single line going from (0,0 to 1,1). Bring it into Techdraw and export as a dxf. Open the dxf in a text editor and look at the entities section. Infer from that what your 49 degree line would look like.
Post Reply