TechDraw ExportPageDXF: Difference between revisions

From FreeCAD Documentation
(Added Maxsegmentlength to Notes and minor changes to that paragraph.)
No edit summary
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:19-->
<!--T:19-->
{{Docnav
{{Docnav
|[[TechDraw_ExportPageSVG|Export Page as SVG]]
|[[TechDraw_ExportPageSVG|ExportPageSVG]]
|[[TechDraw_LineGroup|LineGroup]]
|[[TechDraw_Hatch|Hatch Face using Image File]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_ExportPageSVG.svg
|IconL=TechDraw_ExportPageSVG.svg
|
|IconC=Workbench_TechDraw.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_Hatch.svg
}}
}}


Line 14: Line 15:
{{GuiCommand
{{GuiCommand
|Name=TechDraw ExportPageDXF
|Name=TechDraw ExportPageDXF
|MenuLocation=TechDraw → Export Page as DXF
|MenuLocation=TechDraw → Page → Export Page as DXF
|Workbenches=[[TechDraw Module|TechDraw]]
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|SeeAlso=[[TechDraw_ExportPageSVG|Export Page as SVG]], [[Draft DXF|Draft DXF]]
|Version=0.18
|Version=0.18
|SeeAlso=[[TechDraw_ExportPageSVG|TechDraw Export Page as SVG]], [[Draft_DXF|Draft DXF]]
}}
}}


Line 23: Line 24:


<!--T:8-->
<!--T:8-->
The ExportPageDXF tool saves a drawing page as a [[DXF|DXF]] file
The '''TechDraw ExportPageDXF tool''' saves a drawing page as a [[DXF|DXF]] file.


==Usage== <!--T:3-->
==Usage== <!--T:3-->


<!--T:9-->
<!--T:9-->
# If there are multiple drawing pages in the document: optionally activate the desired page by selecting it in the [[Tree_view|Tree view]].
# Select a Page in the tree view, if the document contains multiple pages.
# There are several ways to invoke the tool:
# Press the {{Button|[[Image:TechDraw_ExportPageDXF.svg|16px]] [[TechDraw_ExportPageDXF|Export Page as DXF]]}} button.
#* Press the {{Button|[[Image:TechDraw_ExportPageDXF.svg|16px]] [[TechDraw_ExportPageDXF|Export Page as DXF]]}} button.
#* Select the {{MenuCommand|TechDraw → Page → [[Image:TechDraw_ExportPageDXF.svg|16px]] Export Page as DXF}} option from the menu.
#* If a page is displayed in the [[Main_view_area|Main view area]]: right-click the page's window and select the {{MenuCommand|Export DXF}} option from the context menu.
# If there are multiple drawing pages in the document and you have not yet activated a page, the {{MenuCommand|Page Chooser}} dialog box opens: {{Version|0.20}}
## Select the desired page.
## Press the {{Button|OK}} button.
# The {{MenuCommand|Save DXF file}} dialog box opens.
# Select a location and file name.
# Select a location and file name.


=== Limitations === <!--T:21-->
===Limitations=== <!--T:21-->


<!--T:22-->
<!--T:22-->
Line 38: Line 46:
* Scaling is not supported. The DXF will be drawn in the actual size of the TechDraw page.
* Scaling is not supported. The DXF will be drawn in the actual size of the TechDraw page.
* Units are not supported. The DXF will be drawn in millimeters (mm). Dimension text will be shown exactly as displayed in TechDraw.
* Units are not supported. The DXF will be drawn in millimeters (mm). Dimension text will be shown exactly as displayed in TechDraw.
* TechDraw can't export a [[TechDraw_DraftView|Insert Draft Workbench Object]] or an [[TechDraw_ArchView|Insert Arch Workbench Object]] to DXF. These views are [[SVG|SVG]] elements generated internally by the [[Draft Workbench|Draft Workbench]], so there is no geometrical shape to export. To export a view as DXF, it must have been created with [[TechDraw_View|Insert View]] or [[TechDraw_ProjectionGroup|Insert Projection Group]]. For example, select an [[Arch SectionPlane|Arch SectionPlane]], then use [[Draft Shape2DView|Draft Shape2DView]] to create a flat projection shape, and then use [[TechDraw_View|Insert View]] on this object. Alternatively, select the objects from the tree view or the 3D viewport, and export to DXF using {{MenuCommand|File → [[Std Export|Export]]}}.
* TechDraw can't export a [[TechDraw_DraftView|Insert Draft Workbench Object]] or an [[TechDraw_ArchView|Insert Arch Workbench Object]] to DXF. These views are [[SVG|SVG]] elements generated internally by the [[Draft_Workbench|Draft Workbench]], so there is no geometrical shape to export. To export a view as DXF, it must have been created with [[TechDraw_View|Insert View]] or [[TechDraw_ProjectionGroup|Insert Projection Group]]. For example, select an [[Arch_SectionPlane|Arch SectionPlane]], then use [[Draft_Shape2DView|Draft Shape2DView]] to create a flat projection shape, and then use [[TechDraw_View|Insert View]] on this object. Alternatively, select the objects from the tree view or the 3D viewport, and export to DXF using {{MenuCommand|File → [[Std Export|Export]]}}.
* The title block of a page is an [[SVG|SVG]] template as well, so it will not be exported to DXF either.
* The title block of a page is an [[SVG|SVG]] template as well, so it will not be exported to DXF either.
* In general, TechDraw can only export to DXF those elements that are supported by the {{incode|Import::ImpExpDxfWrite}} class of the [[Import Module|Import Module]].
* In general, TechDraw can only export to DXF those elements that are supported by the {{incode|Import::ImpExpDxfWrite}} class of the [[Draft_DXF|Import Module]].


== Notes == <!--T:7-->
==Notes== <!--T:7-->


<!--T:13-->
<!--T:13-->
Line 48: Line 56:
** R12 is an older, simpler version of the standard, but should be readable by most other software.
** R12 is an older, simpler version of the standard, but should be readable by most other software.
** R14 is the default version. It includes support for splines and ellipses among other things.
** R14 is the default version. It includes support for splines and ellipses among other things.
* These parameters affect DXF output:
* These parameters affect the output:
** {{MenuCommand|Tools → Edit parameters → BaseApp/Preferences/Mod/Import → DxfVersionOut}}. This is an integer value. Valid entries are 12 or 14. The default is 14.
** {{MenuCommand|Tools → Edit parameters → BaseApp/Preferences/Mod/Import → DxfVersionOut}}. This is an integer value. Valid entries are 12 or 14. The default is 14.
** {{MenuCommand|Tools → Edit parameters → BaseApp/Preferences/Mod/Import → DiscretizeEllipses}}. This is a boolean value. If {{TRUE}}, splines and ellipses are converted to polylines; if {{FALSE}}, splines and ellipses are written as splines and ellipses objects. The default is {{FALSE}}. If the DxfVersionOut parameter is 12, splines and ellipses are always converted to polylines.
** {{MenuCommand|Tools → Edit parameters → BaseApp/Preferences/Mod/Import → DiscretizeEllipses}}. This is a boolean value. If {{TRUE}}, splines and ellipses are converted to polylines; if {{FALSE}}, splines and ellipses are written as splines and ellipses objects. The default is {{FALSE}}. If the DxfVersionOut parameter is 12, splines and ellipses are always converted to polylines.
** {{MenuCommand|Tools → Edit parameters → BaseApp/Preferences/Mod/Import → Maxsegmentlength}}. This is a float value. If splines and ellipses are converted to polylines this parameter determines the segment length.
** {{MenuCommand|Tools → Edit parameters → BaseApp/Preferences/Mod/Import → maxsegmentlength}}. This is a float value. If splines and ellipses are converted to polylines this parameter determines the segment length.


==Scripting== <!--T:6-->
==Scripting== <!--T:6-->


<!--T:15-->
<!--T:15-->
{{Emphasis|See also:}} [[TechDrawGui API|TechDrawGui API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:16-->
<!--T:16-->
The SaveDXF tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following functions:
The SaveDXF tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following functions:


</translate>
</translate>
Line 66: Line 74:
}}
}}
<translate>
<translate>



<!--T:20-->
<!--T:20-->
{{Docnav
{{Docnav
|[[TechDraw_ExportPageSVG|Export Page as SVG]]
|[[TechDraw_ExportPageSVG|ExportPageSVG]]
|[[TechDraw_LineGroup|LineGroup]]
|[[TechDraw_Hatch|Hatch Face using Image File]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_ExportPageSVG.svg
|IconL=TechDraw_ExportPageSVG.svg
|
|IconC=Workbench_TechDraw.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_Hatch.svg
}}
}}


<!--T:17-->
{{TechDraw Tools navi}}

<!--T:18-->
{{Userdocnavi}}
</translate>
</translate>
{{TechDraw Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}

Latest revision as of 21:43, 24 July 2023

TechDraw ExportPageDXF

Menu location
TechDraw → Page → Export Page as DXF
Workbenches
TechDraw
Default shortcut
None
Introduced in version
0.18
See also
TechDraw Export Page as SVG, Draft DXF

Description

The TechDraw ExportPageDXF tool saves a drawing page as a DXF file.

Usage

  1. If there are multiple drawing pages in the document: optionally activate the desired page by selecting it in the Tree view.
  2. There are several ways to invoke the tool:
    • Press the Export Page as DXF button.
    • Select the TechDraw → Page → Export Page as DXF option from the menu.
    • If a page is displayed in the Main view area: right-click the page's window and select the Export DXF option from the context menu.
  3. If there are multiple drawing pages in the document and you have not yet activated a page, the Page Chooser dialog box opens: introduced in version 0.20
    1. Select the desired page.
    2. Press the OK button.
  4. The Save DXF file dialog box opens.
  5. Select a location and file name.

Limitations

  • Radial and Diameter dimensions will only export properly if they are "inside" the arc.
  • Scaling is not supported. The DXF will be drawn in the actual size of the TechDraw page.
  • Units are not supported. The DXF will be drawn in millimeters (mm). Dimension text will be shown exactly as displayed in TechDraw.
  • TechDraw can't export a Insert Draft Workbench Object or an Insert Arch Workbench Object to DXF. These views are SVG elements generated internally by the Draft Workbench, so there is no geometrical shape to export. To export a view as DXF, it must have been created with Insert View or Insert Projection Group. For example, select an Arch SectionPlane, then use Draft Shape2DView to create a flat projection shape, and then use Insert View on this object. Alternatively, select the objects from the tree view or the 3D viewport, and export to DXF using File → Export.
  • The title block of a page is an SVG template as well, so it will not be exported to DXF either.
  • In general, TechDraw can only export to DXF those elements that are supported by the Import::ImpExpDxfWrite class of the Import Module.

Notes

  • This function exports the R12 (AC1009) and R14 (AC1014) versions of DXF.
    • R12 is an older, simpler version of the standard, but should be readable by most other software.
    • R14 is the default version. It includes support for splines and ellipses among other things.
  • These parameters affect the output:
    • Tools → Edit parameters → BaseApp/Preferences/Mod/Import → DxfVersionOut. This is an integer value. Valid entries are 12 or 14. The default is 14.
    • Tools → Edit parameters → BaseApp/Preferences/Mod/Import → DiscretizeEllipses. This is a boolean value. If true, splines and ellipses are converted to polylines; if false, splines and ellipses are written as splines and ellipses objects. The default is false. If the DxfVersionOut parameter is 12, splines and ellipses are always converted to polylines.
    • Tools → Edit parameters → BaseApp/Preferences/Mod/Import → maxsegmentlength. This is a float value. If splines and ellipses are converted to polylines this parameter determines the segment length.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

The SaveDXF tool can be used in macros and from the Python console by using the following functions:

TechDraw.writeDXFPage(page,filename)