Draft DXF/de: Difference between revisions

From FreeCAD Documentation
(Created page with "{{Emphasis|Note:}} Aus Lizenzgründen sind die DXF - Import-/Exportbibliotheken nicht mehr Bestandteil des FreeCAD-Quellcodes. Aus diesem Grund müssen sie von Dir, de...")
No edit summary
 
(77 intermediate revisions by 4 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>
== Einleitung ==
==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.
Die folgenden DXF-Objekttypen werden derzeit unterstützt:

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.

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

Dieses Importmodul kann folgende DXF-Objekte importieren:
* Linien
* Linien
* Polylinien und Lwpolylinien
* Polylinien und Lwpolylinien
* Bögen
* Kreise
* Kreise
* Splines
* Kreisbögen
* Punkte
* Ebenen (Ebenen mit Objekten werden in FreeCAD Groups konvertiert)
* Texte und Mtexte
* Texte und Mtexte
* Maße
* Maße
* Hinweislinien
* Blöcke (nur Geometrie. Texte, Maße und Attribute in Blöcken werden übersprungen)
* Blöcke (nur Geometrie; Texte, Maße und Attribute innerhalb von Blöcken werden übersprungen)
* Punkte {{Version | 0.13}}
* Layer
* Vorlaufe {{Version | 0.13}}
* "paper space objects"


===Legacy importer===
Andere DXF-Objekte werden derzeit nicht importiert, da kein entsprechendes FreeCAD-Objekt vorhanden ist. Sobald neue Funktionen implementiert werden, können weitere Objekttypen importiert werden.


Dieses Importmodul kann folgende DXF-Objekte importieren:
== Installieren ==
* Linien
* Polylinien und Lwpolylinien
* Bögen
* Kreise
* Ellipsen
* Splines
* 3D-Flächen
* Texte und Mtexte
* Hinweislinien
* Layer


<span id="Exporting"></span>
{{Emphasis|Note:}} Aus Lizenzgründen sind die [[DXF|DXF]] - Import-/Exportbibliotheken nicht mehr Bestandteil des FreeCAD-Quellcodes. Aus diesem Grund müssen sie von Dir, dem Benutzer, nach der Installation von FreeCAD installiert werden. Es gibt eine Möglichkeit, FreeCAD dies automatisch zu erlauben oder dies manuell durchzuführen.
==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.
=== Automatically ===


<span id="C++_exporter"></span>
Starting from version 0.15, you only need to mark the {{MenuCommand|Edit → Preferences → Import/Export → DXF/DWG → "Allow FreeCAD to automatically download the DXF libraries"}} option to have FreeCAD take automatically care of downloading and installing these libraries. For older versions, you will need to do it manually.
===C++ Export-Modul===


Some of the features and limitations of this exporter are:
=== Manually ===
* 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.


===Legacy exporter===
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.


Einige Merkmale und Eischränkungen dieses Exportmoduls sind:
== Importing ==
* 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.
This works the same way as opening, but it will add the contents of the DXF file in the active document instead of creating a new document.
* 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.


<span id="Installing"></span>
Tutorial: [[Dxf_Importer_Install|Dxf Importer Install]]
==Installieren==


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.
== Exporting ==
Für weitere Informationen siehe: [[FreeCAD_and_DXF_Import/de|FreeCAD und DXF Import]].
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


== Preferences ==
<span id="Preferences"></span>
==Einstellungen==
The following parameters can be specified in the [[Preferences Editor|Preferences Editor]], in the menu {{MenuCommand|Edit → Preferences → Import-Export}}.
* Import style: This lets you choose the way objects from the dxf file will be drawn in FreeCAD. You can choose between:
** None: this is the faster way, there is no conversion, all objects will be black with 2px width (FreeCAD default)
** Use default color and linewidth: All imported dxf objects will take current linewidth/color from the draft command bar
** Original color and linewidth: Objects will keep the color and linewidth (if specified) they have in the dxf file
** 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]] available here.
* Import texts: This allows you to specify whether you want to import dxf texts and dimensions. Many texts might make your work in FreeCAD very difficult, 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 as model space objects.


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

{{Emphasis|Siehe auch:}} [[Draft API/de|Draft API]] und [[FreeCAD Scripting Basics/de|FreeCAD Scripting Basics]].
== 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)
polygon1 = Draft.make_polygon(3, radius=500)
Polygon2 = Draft.makePolygon(5, radius=1500)
polygon2 = Draft.make_polygon(5, radius=1500)


doc.recompute()
objects = [Polygon1, Polygon2]


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")