TechDraw: export View to DXF

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw: export View to DXF

Post by wandererfan »

Looks like __objs__ is a list of DocumentObjects with a Shape property. Need to either give DrawViewPart a Shape property or
make a version of "importDXF.export" that takes raw edges as input.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: TechDraw: export View to DXF

Post by easyw-fc »

wandererfan wrote: Mon Mar 19, 2018 5:59 pm Looks like __objs__ is a list of DocumentObjects with a Shape property. Need to either give DrawViewPart a Shape property or
make a version of "importDXF.export" that takes raw edges as input.
have you seen @ row 1935 of importDXF.py

Code: Select all

        elif (len(exportList) == 1) and (exportList[0].isDerivedFrom("TechDraw::DrawPage")):
            # page: special hack-export! (see below)
            exportPage(exportList[0],filename)
and later

Code: Select all

def exportPage(page,filename):
it seems there was some WIP

Code: Select all

    elif view.isDerivedFrom("TechDraw::DrawViewDraft"):
        geom = Draft.getDXF(view)
        block,insert,blockcount = getViewBlock(geom,view,blockcount)
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw: export View to DXF

Post by wandererfan »

Looks like only for DraftView with Svg to Dxf conversion, but I'll look deeper.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw: export View to DXF

Post by wandererfan »

easyw-fc wrote: Sun Mar 18, 2018 6:01 pm Yes, LibreCAD 2.13 compared to LCAD 2.09
How does this file look in 2.13? It was converted by importDXF.export.
Attachments
export.dxf
(13.64 KiB) Downloaded 124 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: TechDraw: export View to DXF

Post by NormandC »

This is how it looks in LibreCAD 2.2.0-alpha.
Attachments
FC_wandererfan_export_lcad22a.png
FC_wandererfan_export_lcad22a.png (6.2 KiB) Viewed 2110 times
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: TechDraw: export View to DXF

Post by easyw-fc »

wandererfan wrote: Tue Mar 20, 2018 11:53 pm
easyw-fc wrote: Sun Mar 18, 2018 6:01 pm Yes, LibreCAD 2.13 compared to LCAD 2.09
How does this file look in 2.13? It was converted by importDXF.export.
it is perfect!
The good news are that this format is also directly compatible/readable with Adobe products, where the old export was not :D
TDtoDXF-7.gif
TDtoDXF-7.gif (198.78 KiB) Viewed 2098 times
Very nice and useful addition! Looking forward to see it in the main stream :)
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: TechDraw: export View to DXF

Post by easyw-fc »

wandererfan wrote: Tue Mar 20, 2018 11:53 pm
easyw-fc wrote: Sun Mar 18, 2018 6:01 pm Yes, LibreCAD 2.13 compared to LCAD 2.09
How does this file look in 2.13? It was converted by importDXF.export.
Hi,
Are you going to PR this to FC 0.18?
:)
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw: export View to DXF

Post by wandererfan »

easyw-fc wrote: Tue Apr 17, 2018 6:07 pm Are you going to PR this to FC 0.18?
Patience is a virtue. :lol:
User avatar
geolux
Posts: 70
Joined: Sat May 04, 2019 10:27 am
Location: Italy
Contact:

Re: TechDraw: export View to DXF

Post by geolux »

Hallo group,
I'm having a problem with the DXF export of Architectural section and I think that my issue is similar, this is the post:
https://forum.freecadweb.org/viewtopic.php?f=3&t=36131
Have you some advices?
Thank you
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: TechDraw: export View to DXF

Post by easyw-fc »

wandererfan wrote: Tue Apr 24, 2018 8:20 pm ping
Hi @wanderfan
I realized that I can read a DXF using the new readDXF function.

Code: Select all

import Import
Import.readDXF.__doc__
'readDXF(filename,[document,ignore_errors]): Imports a DXF file into the given document. ignore_errors is True by default.'
What I noticed is that if I use the 'Import.writeDXFObject'

Code: Select all

Import.writeDXFObject.__doc__
'writeDXFObject([objects],filename [,version,usePolyline,optionSource]): Exports DocumentObject(s) to a DXF file.'
I can write DXF also with bsplines... Cool 8-)
But If I read back the DXF with Import.readDXF I miss the bsplines... :(

Could it be possible to add bsplines also on Import.readDXF function?

here a sample
write-read-dxf.FCStd
(5.75 KiB) Downloaded 47 times
write-sketch.dxf
(5.11 KiB) Downloaded 84 times
Thanks
Maurice
Post Reply