Draft DXF/de: Difference between revisions

From FreeCAD Documentation
(Created page with "{{Userdocnavi/de}}")
No edit summary
 
(87 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{docnav/de
{{Docnav/de
|
|[[Draft_SVG/de|SVG]]
|[[Draft_Preferences/de|Einstellungen]]
|[[Draft_SVG/de|Scalable Vector Graphics .SVG]]
|[[Draft_Module/de|Draft-Arbeitsbereich]]
|[[Draft_Workbench/de|Draft]]
|IconL=
|IconR=
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}


{{TOCright}}
{{GuiCommand
|Name=Draft DXF|Name/de=Draft DXF
|MenuLocation=Datei → Export → Autodesk DXF 2D (*.dxf)
|Workbenches=[[Draft Workbench/de|Draft]]
|Shortcut={{KEY|Strg}}+{{KEY|E}}
|SeeAlso=[[FreeCAD and DXF Import/de|FreeCAD und DXF Import]], [[FreeCAD and DWG Import/de|FreeCAD und DWG Import]]
|Empty=1
}}


<span id="Description"></span>
== Beschreibung ==
==Beschreibung==
{{Emphasis|Siehe auch:}} [[FreeCAD and DXF Import/de|FreeCAD und DXF Import]] und [[FreeCAD and DWG Import/de|FreeCAD und DWG Import]].


Draft DXF ist ein Softwaremodul, das von den [[File:Std_Open.svg|24px]] [[Std_Open/de|Std Öffnen]], [[File:Std_Import.svg|24px]] [[Std_Import/de|Std Import]] und [[File:Std_Export.svg|24px]][[Std_Export/de|Std Export]] Befehlen verwendet wird, um das DXF-Dateiformat zu verarbeiten.
Diese Funktion öffnet eine [[DXF/de|DXF]]-Datei (Version 12 bis 2007) in ein neues Dokument.


[[Image:Screenshot qcad.jpg]]
[[Image:Screenshot qcad.jpg]]
{{Caption|Qcad-Zeichnung nach DXF exportiert, die anschließend in FreeCAD geöffnet wird}}
{{Caption|Qcad-Zeichnung nach DXF exportiert, die anschließend in FreeCAD geöffnet wird}}


<span id="Importing"></span>
== Opening ==
==Importieren==


Es stehen zwei Import-Module zur Verfügung, die unter {{MenuCommand|Bearbeiten → Einstellungen... → Import-Export → DXF}} festgelegt werden können: Der eine ist eingebaut, C++ basiert und schnell, der andere ist eine Altlast, in Python kodiert, langsamer und erfordert die Installation einer Erweiterung, kann aber manche Objekte besser verarbeiten und kann feinere FreeCAD-Objekte erstellen. Beide unterstützen alle DXF-Versionen seit R12.
The following DXF object types are currently supported:
* lines
* polylines and lwpolylines
* circles
* arcs
* layers (layers containing objects are converted to FreeCAD Groups)
* texts and mtexts
* dimensions
* blocks (only geometry. texts, dims and attributes inside blocks will be skipped)
* points {{Version|0.13}}
* leaders {{Version|0.13}}


3D-Festkörper innerhalb einer DXF-Datei werden unter einem binären "ACIS/SAT-Blob" gespeichert, der zur Zeit von FreeCAD nicht gelesen werden kann.
Other DXF entities are currently not imported because there is no corresponding FreeCAD object. As new functionality gets implemented, it will be possible to import more entity types.


<span id="C++_importer"></span>
== Installing ==
===C++ Import-Modul===


Dieses Importmodul kann folgende DXF-Objekte importieren:
{{Emphasis|Note:}} for licensing reasons, the [[DXF]] import/export libraries are not part of the FreeCAD source code anymore. For that reason, they must be installed by you, the user, after you install FreeCAD. There is a way to allow FreeCAD to do that automatically, or you can do it manually.
* Linien
* Polylinien und Lwpolylinien
* Bögen
* Kreise
* Splines
* Punkte
* Texte und Mtexte
* Maße
* Hinweislinien
* Blöcke (nur Geometrie; Texte, Maße und Attribute innerhalb von Blöcken werden übersprungen)
* Layer
* "paper space objects"


=== Automatically ===
===Legacy importer===


Dieses Importmodul kann folgende DXF-Objekte importieren:
Starting from version 0.15, you only need to mark the Edit-> Preferences -> Import/Export -> DXF/DWG -> "Allow FreeCAD to automatically download the DXF libraries" option to have FreeCAD take automatically care of doenloading and installing these libraries. For older versions, you will need to do it manually.
* Linien
* Polylinien und Lwpolylinien
* Bögen
* Kreise
* Ellipsen
* Splines
* 3D-Flächen
* Texte und Mtexte
* Hinweislinien
* Layer


<span id="Exporting"></span>
=== Manually ===
==Exportieren==


Es gibt auch zwei Export-Module: Das Altdaten-Export-Modul exportiert in das DXF-Format R12, Das C++ Export-Modul in das DXF-Format R14. Beide Formate können mit vielen Programmen verarbeitet werden.
Libraries must be downloaded from https://github.com/yorikvanhavre/Draft-dxf-importer
There is a very complete step-by-step [[Dxf_Importer_Install|tutorial]] that will explain you the necessary steps.


<span id="C++_exporter"></span>
== Importing ==
===C++ Export-Modul===
This works the same way as opening, but it will add the contents of the dxf file in the active documento instead of creating a new document.


Some of the features and limitations of this exporter are:
Tutorial: [[Dxf_Importer_Install|Dxf Importer Install]]
* All FreeCAD 2D geometry is exported, except [[Draft_CubicBezCurve|Draft CubicBezCurves]], [[Draft_BezCurve|Draft BezCurves]] and [[Draft_Point|Draft Points]].
* Straight edges from faces of 3D objects are exported, but curved edges only if they are on a plane parallel to the XY plane of the global coordinate system. Note that a DXF created from 3D objects will contain duplicate lines.
* Texts and dimensions are not exported.
* Colors are ignored.
* Layers are mapped from object names.


== Exporting ==
===Legacy exporter===
The exported DXF is compatible with Autocad version 12 and up, so it should open in about any application that supports dxf format.
Currently the following FreeCAD objects get exported:
* lines and wires (polylines)
* arcs and circles
* texts
* colors are mapped from objects RGB colors to autocad color index (ACI). Black will always be "by layer"
* layers are mapped from group names. When groups are nested, the deepest group gives the layer name.
* dimensions, which are exported with "Standard" dimstyle


Einige Merkmale und Eischränkungen dieses Exportmoduls sind:
== Preferences ==
* Die gesamte 2D-Geometrie von FreeCAD wird exportiert außer [[Draft_Point/de|Draft-Punkten]]. Aber Ellipsen, B-Splines und Bézierkurve werden nicht ordentlich exportiert.
The following parameters can be specified in the [[Preferences Editor]], in the menu {{MenuCommand|Edit → Preferences → Import-Export}}.
* 3D-Objekte werden als objects are exported as eingeebnete 2D-Ansicht exportiert.
* Import style: This lets you choose the way objects from the dxf file will be drawn in FreeCAD. You can choose between:
* Verbundobjekte werden als Blöcke exportiert.
** None: this is the faster way, there is no conversion, all objects will be black with 2px width (FreeCAD default)
* Texte und Maße werden exportiert.
** Use default color and linewidth: All imported dxf objects will take current linewidth/color from the draft command bar
* Die Farben im DXF-Dokument basieren auf der Linienfarbe der Objekte. Schwarz wird als "ByBlock" zugeordnet, andere Farben verwenden den AutoCAD-Color-Index (ACI) zum Zuordnen.
** Original color and linewidth: Objects will keep the color and linewidth (if specified) they have in the dxf file
* Layer werden nach Layer- und Gruppennamen zugeordnet. Wenn Gruppen verschachtelt sind, gibt die tiefste Gruppe den Layernamen an.
** Colors mapped to linewidth: If this option is selected, the mapping file option below is used.
* Color mapping file: This allows you to specify a mapping file to be used for translating dxf colors to color and linewidth, the same way as a plot style works in Autocad. The mapping file must be a tab-separated text file. There is a nice free utility called [http://www.noliturbare.com/TablePrintGUI.php Plot style viewer] that can convert Autocad CTB or STB (plot styles) files to tab-separated mapping files ready to use in FreeCAD. Alternatively, we have a couple of [[Draft_mapping_files|home-made mapping files]] availables here.
* Import texts: This allows you to specify if you want to import dxf texts and dimensions or not. Many texts might make your work in FreeCAD very heavy, so you might want to use this option some time.
* Import layout objects: Turn this on if you want to import paper space object. They will be merged in the same document than model space objects.


<span id="Installing"></span>
==Scripting==
==Installieren==
{{Emphasis|Siehe auch:}} [[Draft API/de|Draft API]] und [[FreeCAD Scripting Basics/de|FreeCAD Scripting Basics]].

Aus lizenzrechtlichen Gründen sind die benötigten [[DXF/de|DXF]] Import/Export Bibliotheken, die von der Legacy Version des Importeurs benötigt werden, nicht Teil des FreeCAD Quellcodes.
Für weitere Informationen siehe: [[FreeCAD_and_DXF_Import/de|FreeCAD und DXF Import]].

<span id="Preferences"></span>
==Einstellungen==

Siehe [[Import_Export_Preferences/de|Import-Export-Einstellungen]].

== DWG ==

Because the DWG format is a proprietary, closed and undocumented format it is hard for open-source projects like FreeCAD to support it. That is why FreeCAD relies on external converters to read and write DWG files. To import a DWG file a converter is used to create a DXF first, which can then be processed by the FreeCAD DXF importer. When exporting to DWG the opposite conversion happens: the DXF created by the FreeCAD DXF exporter is turned into a DWG.

Note that the DXF format allows a 1:1 conversion of the DWG format. All applications that can read and write DWG files can do the same with DXF files, with no data loss. So asking for DXF files instead of DWG files, and supplying DXF files in turn, should not cause any problems.

There is built-in support for the following DWG converters:
* [https://www.gnu.org/software/libredwg LibreDWG] (open-source, lacks support for some DWG entities).
* [https://www.opendesign.com/guestfiles/oda_file_converter ODA File Converter] (free).
* [https://qcad.org/en/qcad-command-line-tools#dwg2dwg QCAD pro] (commercial). {{Version|0.20}}

See [[Import_Export_Preferences#DWG|Import Export Preferences]] and [[FreeCAD_and_DWG_Import|FreeCAD and DWG Import]] for more information.

<span id="Scripting"></span>
==Skripten==

Siehe auch: [https://freecad.github.io/SourceDoc/ Autogenerierte API Dokumentation] und [[FreeCAD_Scripting_Basics/de|FreeCAD Grundlagen Skripten]].

Um Objekte in eine DXF-Datei zu exportieren, wird die Methode {{incode|export}} des Moduls importDXF verwendet.


Du kannst durch die folgende Funktion Elemente nach DXF exportieren:
{{Code|code=
{{Code|code=
importDXF.export(objectslist, filename, nospline=False, lwPoly=False)
importDXF.export(objectslist, filename, nospline=False, lwPoly=False)
}}
}}

* Für Windows: {{FileName|/}} (forward slash) wird als Pfad-Trennzeichen in {{Incode|filename}} verwendet.


Beispiel:
Beispiel:

{{Code|code=
{{Code|code=
import Draft, importDXF
import FreeCAD as App
import Draft
import importDXF


doc = App.newDocument()
Polygon1 = Draft.makePolygon(3, radius=500)
Polygon2 = Draft.makePolygon(5, radius=1500)


polygon1 = Draft.make_polygon(3, radius=500)
objects = [Polygon1, Polygon2]
polygon2 = Draft.make_polygon(5, radius=1500)


doc.recompute()

objects = [polygon1, polygon2]
importDXF.export(objects, "/home/user/Pictures/myfile.dxf")
importDXF.export(objects, "/home/user/Pictures/myfile.dxf")
}}
}}



{{docnav/de
{{Docnav/de
|
|[[Draft_SVG/de|SVG]]
|[[Draft_Preferences/de|Einstellungen]]
|[[Draft_SVG/de|Scalable Vector Graphics .SVG]]
|[[Draft_Module/de|Draft-Arbeitsbereich]]
|[[Draft_Workbench/de|Draft]]
|IconL=
|IconR=
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}


{{Draft Tools navi/de}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

[[Category:File Formats{{#translation:}}]]
{{Userdocnavi/de}}
{{clear}}

Latest revision as of 19:35, 10 January 2024

Beschreibung

Draft DXF ist ein Softwaremodul, das von den Std Öffnen, Std Import und Std Export Befehlen verwendet wird, um das DXF-Dateiformat zu verarbeiten.

Qcad-Zeichnung nach DXF exportiert, die anschließend in FreeCAD geöffnet wird

Importieren

Es stehen zwei Import-Module zur Verfügung, die unter Bearbeiten → Einstellungen... → Import-Export → DXF festgelegt werden können: Der eine ist eingebaut, C++ basiert und schnell, der andere ist eine Altlast, in Python kodiert, langsamer und erfordert die Installation einer Erweiterung, kann aber manche Objekte besser verarbeiten und kann feinere FreeCAD-Objekte erstellen. Beide unterstützen alle DXF-Versionen seit R12.

3D-Festkörper innerhalb einer DXF-Datei werden unter einem binären "ACIS/SAT-Blob" gespeichert, der zur Zeit von FreeCAD nicht gelesen werden kann.

C++ Import-Modul

Dieses Importmodul kann folgende DXF-Objekte importieren:

  • Linien
  • Polylinien und Lwpolylinien
  • Bögen
  • Kreise
  • Splines
  • Punkte
  • Texte und Mtexte
  • Maße
  • Hinweislinien
  • Blöcke (nur Geometrie; Texte, Maße und Attribute innerhalb von Blöcken werden übersprungen)
  • Layer
  • "paper space objects"

Legacy importer

Dieses Importmodul kann folgende DXF-Objekte importieren:

  • Linien
  • Polylinien und Lwpolylinien
  • Bögen
  • Kreise
  • Ellipsen
  • Splines
  • 3D-Flächen
  • Texte und Mtexte
  • Hinweislinien
  • Layer

Exportieren

Es gibt auch zwei Export-Module: Das Altdaten-Export-Modul exportiert in das DXF-Format R12, Das C++ Export-Modul in das DXF-Format R14. Beide Formate können mit vielen Programmen verarbeitet werden.

C++ Export-Modul

Some of the features and limitations of this exporter are:

  • All FreeCAD 2D geometry is exported, except Draft CubicBezCurves, Draft BezCurves and Draft Points.
  • Straight edges from faces of 3D objects are exported, but curved edges only if they are on a plane parallel to the XY plane of the global coordinate system. Note that a DXF created from 3D objects will contain duplicate lines.
  • Texts and dimensions are not exported.
  • Colors are ignored.
  • Layers are mapped from object names.

Legacy exporter

Einige Merkmale und Eischränkungen dieses Exportmoduls sind:

  • Die gesamte 2D-Geometrie von FreeCAD wird exportiert außer Draft-Punkten. Aber Ellipsen, B-Splines und Bézierkurve werden nicht ordentlich exportiert.
  • 3D-Objekte werden als objects are exported as eingeebnete 2D-Ansicht exportiert.
  • Verbundobjekte werden als Blöcke exportiert.
  • Texte und Maße werden exportiert.
  • Die Farben im DXF-Dokument basieren auf der Linienfarbe der Objekte. Schwarz wird als "ByBlock" zugeordnet, andere Farben verwenden den AutoCAD-Color-Index (ACI) zum Zuordnen.
  • Layer werden nach Layer- und Gruppennamen zugeordnet. Wenn Gruppen verschachtelt sind, gibt die tiefste Gruppe den Layernamen an.

Installieren

Aus lizenzrechtlichen Gründen sind die benötigten DXF Import/Export Bibliotheken, die von der Legacy Version des Importeurs benötigt werden, nicht Teil des FreeCAD Quellcodes. Für weitere Informationen siehe: FreeCAD und DXF Import.

Einstellungen

Siehe Import-Export-Einstellungen.

DWG

Because the DWG format is a proprietary, closed and undocumented format it is hard for open-source projects like FreeCAD to support it. That is why FreeCAD relies on external converters to read and write DWG files. To import a DWG file a converter is used to create a DXF first, which can then be processed by the FreeCAD DXF importer. When exporting to DWG the opposite conversion happens: the DXF created by the FreeCAD DXF exporter is turned into a DWG.

Note that the DXF format allows a 1:1 conversion of the DWG format. All applications that can read and write DWG files can do the same with DXF files, with no data loss. So asking for DXF files instead of DWG files, and supplying DXF files in turn, should not cause any problems.

There is built-in support for the following DWG converters:

See Import Export Preferences and FreeCAD and DWG Import for more information.

Skripten

Siehe auch: Autogenerierte API Dokumentation und FreeCAD Grundlagen Skripten.

Um Objekte in eine DXF-Datei zu exportieren, wird die Methode export des Moduls importDXF verwendet.

importDXF.export(objectslist, filename, nospline=False, lwPoly=False)
  • Für Windows: / (forward slash) wird als Pfad-Trennzeichen in filename verwendet.

Beispiel:

import FreeCAD as App
import Draft
import importDXF

doc = App.newDocument()

polygon1 = Draft.make_polygon(3, radius=500)
polygon2 = Draft.make_polygon(5, radius=1500)

doc.recompute()

objects = [polygon1, polygon2]
importDXF.export(objects, "/home/user/Pictures/myfile.dxf")