From Eyeshot 2023, two new managed classes can be used to import DWG/DXF files: ReadDWG and ReadDXF.
Dealing with DWG/DXF files in Eyeshot requires several additional steps compared to other standard CAD file formats. As all professional CAD systems do, Eyeshot relies on Open Design Alliance for this file format translation. You will find all the necessary DLLs inside the Bin folders of the Eyeshot installation.
Basically, the required steps to read/write DWG/DXF files are:
- Create a new project and add the reference to both Eyeshot and Eyeshot.x64 assemblies
- Change the Target Platform of your Visual Studio project to x64*
*You can also target x86 platform and add Bin\x86\devDept.Eyeshot.x86.dll as a reference.
- Use ReadAutodesk class in your code to load the file and WriteAutodesk class to save the file.
On end-user machines, you need to deploy the whole Bin\x64 content, and the Microsoft Visual C++ 2015 Redistributable Package is also required.
For .NET 6 applications, you can easily add the NuGet package by accessing the Extensions menu in Visual Studio 2022.
An example of how to read/write DWG/DXF files can be found in the DraftingDemo source code sample.