FreeCAD und DWG Import

From FreeCAD Documentation
Revision as of 23:05, 7 February 2021 by Maker (talk | contribs) (Replaced content with "====Einrichtung====")


Warum ist es schwierig, DWG Dateien in FreeCAD zu unterstützen?

Das DWG Format ist ein binäres Dateiformat mit geschlossenem Quellcode, das von FreeCAD nicht direkt unterstützt wird. Es erfordert einen externen Dateikonvertierer eines Drittanbieters, der zuerst konvertiert und dann die Konvertierung zur Verwendung in FreeCAD importiert.

Beachte, dass es zur Zeit nicht möglich ist, 3D DWG in FreeCAD zu importieren. 3D Daten sind als binäre .SAT (ACIS) Daten, ein proprietäres und undokumentiertes Format, eingebettet.

Was benötige ich, um DWG Dateien importieren zu können?

ODA-Konverter (früher Teigha Konverter)

Der ODA Konverter ist ein kleines, frei verfügbares Dienstprogramm, das die Konvertierung zwischen verschiedenen Versionen von DWG und DXF Dateien erlaubt. FreeCAD kann es verwenden, um DWG Import und Export anzubieten, indem DWG Dateien unter der Haube in das DXF Format konvertiert werden und der Dateiinhalt dann mit seinem Standard DXF Importeur importiert wird. Es gelten die Einschränkungen des DXF Importeurs.

Einrichtung

On all platforms, only by installing the appropriate package from https://www.opendesign.com/guestfiles/oda_file_converter. After installation, if the utility is not found automatically by FreeCAD, you might need to set the path to the converter executable manually. open Edit → Preferences → Import-Export → DWG and fill "Path to Teigha File Converter" appropriately.

Für eine ausführlichere Anleitung siehe this tutorial.

Verwendung

Das Programm kann mit der Befehlszeilenschnittstelle oder der grafischen Oberfläche verwendet werden. Achte darauf, die DWG Dateien in ein ASCII Format zu konvertieren.

The program may be used with the command line interface or the graphical interface. Be sure to convert the DWG files to an ASCII-Format.

Befehlszeilenformat ist:

  1. Angegebener Eingabeordner
  2. Angegebener Ausgabeordner
  3. Ausgabe_Version {"ACAD9", "ACAD10", "ACAD12", "ACAD13", "ACAD14", "ACAD2000", "ACAD2004", "ACAD2007", "ACAD2010"}
  4. Ausgabe Dateityp {"DWG", "DXF", "DXB"}
  5. Eingabeordner miteinbeziehen {"0", "1"}
  6. Jede Datei prüfen {"0", "1"}
  7. [optional] Eingabedateifilter (Standard: "*.DWG;*.DXF")

Beispiel unter Linux

 ODAFileConverter "/home/dwg-data" "/home/dxf-data" "ACAD2010" "DXF" "0" "1" "test.dwg"

Die zweite Nummer (Audit) muss 1 sein, andernfalls schlägt sie fehl

Beispiel unter Windows

 "C:\Program Files\ODA\Teigha File Converter 3.08.2\TeighaFileConverter.exe" "Path-To-Input-Directory" "Path-To-Output-Directory" "ACAD2010" "DXF" "0" "1" "Name-Of-A-Test-File.dwg"

CADExchanger Workbench

Installing the CADExchanger Workbench allows for working with DWG files through integration with the paid commercial file converter product CADExchanger. Just follow the instructions in the GitHub repository. You can discuss this workbench on its forum thread.

At the moment, the CADExchanger way is the only one that allows to work with 3D DWG files, by converting them to other 3D formats.

FreeCAD v0.19 and LibreDWG

As from 0.19, FreeCAD doesn't need the ODA converter anymore and can use libreDWG directly. Be aware that, since libreDWG is a work-in-progress, depending on your file, the results might not be the same.

GNU LibreDWG is a free C library to handle DWG files. It aims to be a free replacement for the Open Design Alliance Drawings SDK libraries.

Installation

LibreDWG is included in v 0.19_pre appimages[1]

LibreDWG can be configured to work on Windows by downloading and unzipping the appropriate pre-compiled windows binary and adding the folder to your Windows versions system path.

On Linux:

git clone https://git.savannah.gnu.org/git/libredwg.git
cd libredwg
mkdir build
cd build
cmake ..
make
make install (or use checkinstall, or simply locate & copy the dwg2dxf utility to your executables path, it will be then autodetected by FreeCAD)

Was sind die Alternativen?

DoubleCAD XT

Es gibt auch DoubleCAD XT (https://www.turbocad.com/content/doublecad-xt-v5). Das Programm ist für die persönliche und kommerzielle Nutzung kostenlos. Es erfordert eine kostenlose Anmeldung, um einen Aktivierungscode per E-Mail zu bekommen. Dieses Programm ist nurWindows. Hinweis: Es scheint seit Jahren nicht mehr aktualisiert worden zu sein.

There is also DoubleCAD XT (https://www.turbocad.com/content/doublecad-xt-v5). The program is free for personal and commercial use. It requires a free sign-up to receive an activation code via E-Mail. This Program is windows-only. Note: it does not seem to have been updated for years.

NanoCAD 5.0

There is also nanoCAD 5.0 (https://nanocad.com/products/nanoCAD/download/). The program is free for personal and commercial use. It requires a free sign-up to receive an activation code via E-Mail. This Program is windows-only.

Exportiere Deine AutoCAD Dateien in freundliches Format

Exportiere deine AutoCAD Dateien in ein FreeCAD freundlicheres Format, wie DXF R12 oder R14, SVG und, falls die Version dies unterstützt, IGES. Alle sind bessere Alternativen zum DWG Format, wenn du FreeCAD verwendest.

Exporting your AutoCAD files in a more FreeCAD friendly format, like DXF R12 or R14, SVG, and if version supports it, IGES. All are better alternatives to the DWG format when using FreeCAD.

Es ist wichtig zu wissen, dass es entgegen der landläufigen Meinung keinen Unterschied zwischen dem Inhalt einer Datei gibt, die im DWG oder DXF Format gespeichert ist, sofern es sich um die gleiche Version handelt (z. B. DWG 2014 vs. DXF 2014). Beide Formate werden von Autodesk verwaltet, und beide unterstützen genau dieselben Funktionen. Der Unterschied besteht darin, dass DWG geschlossen (maschinenkodiert) ist, während DXF offen ist.

Was kann ich tun, um zu helfen?

Fördere die Verwendung alternativer Formate

Einfach genommen, höre auf, im DWG Format geleistete Arbeit zu akzeptieren. In der Praxis ist dies oft leichter gesagt als getan. Dennoch wäre es keine schlechte Praxis für Benutzer und Unterstützer von FreeCAD, das DWG Format zu vermeiden und abzulehnen, wann immer es möglich ist.

Simply put, stop accepting work done in DWG format. In practice, this is often easier said than done. Still, it would not be bad practice for users and supporters of FreeCAD to avoid and reject the DWG format whenever possible.

Use the LibreDWG library and file bug reports

In development version as mentioned above you can switch from the proprietary ODA Converter to the free software LibreDWG library for DWG (and DXF) files. Please do this and report any problems you encounter.