Draft DXF
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.
From the user's point of view, the DXF import/export module will be loaded automatically when any of those commands are invoked and the file to open, import or export is a DXF file. The main difference between Std Open and the import command is that the former will create a new FreeCAD document and then do the import, whereas the later will import the DXF file and insert the result in the currently active document.
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.
| Entity | C++ importer | Legacy importer |
|---|---|---|
| Lines | ✓ | ✓ |
| Polylines (and LWPOLYLINES) | ✓ | ✓ |
| Arcs | ✓ | ✓ |
| Circles | ✓ | ✓ |
| Ellipses | ✓ | ✓ |
| Splines | ✓ | ✓ |
| Texts & MTexts | ✓ | ✓ |
| Leaders | ✗ | ✓ |
| Layers | ✓ | ✓ |
| Points | ✓ | ✓ |
| Dimensions | ✓ | ✓ |
| Blocks | ✓ (Geometry only; texts, dimensions, and attributes inside blocks are skipped) |
✓ |
| Paper space objects | ✓ | ✓ |
| 3D Faces | ✗ | ✓ |
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.
| Feature | C++ exporter (R14) | Legacy exporter (R12) |
|---|---|---|
| Supported 2D Geometry | All except Bezier curves. Ellipses and Splines are exported natively. | All except Points. Ellipses and B-splines may be inaccurate or exported as polylines. |
| Points | ✓ (If the "Export points" preference is enabled) |
✗ |
| 3D Objects | Edges from faces are exported. Curved edges only if on XY plane. May create duplicate lines. | Exported as flattened 2D views. |
| Texts and Dimensions | ✗ | ✓ |
| Colors | ✗ | ✓ (Based on object line color) |
| Layers | ✓ (Mapped from object names) |
✓ (Mapped from layers and nested groups) |
| Compounds | ✗ | ✓ (Exported as blocks) |
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:
- LibreDWG (open-source, lacks support for some DWG entities).
- ODA File Converter (free).
- QCAD pro (commercial).
Siehe Import Export Einstellungen, FreeCAD and DWG Import für mehr Informationen.
Skripten
Siehe auch: Autogenerierte API-Dokumentation und Grundlagen der Skripterstellung in FreeCAD.
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
filenameverwendet.
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")
- Drafting: Line, Polyline, Fillet, Arc, Arc From 3 Points, Circle, Ellipse, Rectangle, Polygon, B-Spline, Cubic Bézier Curve, Bézier Curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation Styles, Annotation Scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar Array, Circular Array, Path Array, Path Link Array, Point Array, Point Link Array, Edit, Highlight Subelements, Join, Split, Upgrade, Downgrade, Convert Wire/B-Spline, Draft to Sketch, Set Slope, Flip Dimension, Shape 2D View
- Draft Tray: Working Plane, Set Style, Toggle Construction Mode, AutoGroup
- Snapping: Snap Lock, Snap Endpoint, Snap Midpoint, Snap Center, Snap Angle, Snap Intersection, Snap Perpendicular, Snap Extension, Snap Parallel, Snap Special, Snap Near, Snap Ortho, Snap Grid, Snap Working Plane, Snap Dimensions, Toggle Grid
- Miscellaneous: Apply Current Style, New Layer, Manage Layers, New Named Group, SelectGroup, Add to Layer, Add to Group, Add to Construction Group, Toggle Wireframe, Working Plane Proxy, Heal, Show Snap Toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Most objects: Edit
- Layer container: Add New Layer, Reassign Properties of All Layers, Merge Layer Duplicates
- Layer: Activate Layer, Reassign Properties of Layer, Select Layer Contents
- Text and label: Open Links
- Wire: Flatten
- Working plane proxy: Save Camera Position, Save Visibility of Objects
- Erste Schritte
- Installation: Herunterladen, Windows, Linux, Mac, Zusätzliche Komponenten, Docker, AppImage, Ubuntu Snap
- Grundlagen: Über FreeCAD, Graphische Oberfläche, Mausbedienung, Auswahlmethoden, Objektname, Voreinstellungseditor, Arbeitsbereiche, Dokumentstruktur, Objekteigenschaften, FreeCAD unterstützen, Spenden
- Hilfe: Anleitungen, Videoanleitungen
- Arbeitsbereiche: Std Base, Arch, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
