Reading DWG/DXF (v6)

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. This tool still contains some legacy DLLs that cannot be copied automatically by Visual Studio. You'll find all the necessary DLLs inside the Bin20/Bin40 folders of the Eyeshot installation.

Basically, the required steps to read/write DWG/DXF files are:

  1. Select between .NET 2.0 or .NET 4.0 and install the proper Microsoft Visual C++ Redistributable Package (2008 or 2010)
  2. Select between x86 or x64 platform and manually copy all the Eyeshot DLLs and *.tx files to your Bin/Debug or Bin/Release folder
  3. Reference the relevant Eyeshot DLL in your Visual Studio project (its name terminates with .x86.dll or .x64.dll)
  4. Add the ViewportLayout.ReadAutodesk()/WriteAutodesk() call in your code

The attached sample performs a DWG read based on .NET Framework 2.0 and x86 as target platform. It also include the Microsoft Visual C++ 2008 Redistributable Package in the case you still need to install it.

Was this article helpful?
3 out of 3 found this helpful
Have more questions? Submit a request


  • This sample worked fine when i run in VS2010 with target as framework 2.0

    When i change the framework to 4.0 and i use the x86 dll in bin 40 and run the program, i dont get any error, but the dwg file is not loaded in the screen.

    I have the vc++ redistributable package 2010, refer attachment. Please help here.

  • It's not enough to reference the bin40 Eyeshot dll. You also need to copy all the dlls and tx files from the bin40 folder to your execution folder, as explained in the documentation.

  • Hi, have done the same but doesnt work for x86 and .net 4.0. But works with x64 and .net 4.0 though but again in x64, cannot see design view of the forms.

  • The VisualStudio designer only works with x86 or AnyCpu assemblies, that's a Visual Studio limitation.

  • Hi, I've downloaded trial version of your product. We develop WPF application and want to use your conrol inside WindowsFormsHost control. We need to load DWG/DXF files. Your control loads them but when application is closed I get System.InvalidOperationException (smth with GCHandle). If I switch to WindowsFormsapplication project everything works fine. Is there any way to fix this problem? I think your control is perfect for our application and we will buy it if everything will be fine.

    Thank you.

    Robert Smith.

  • Hi,

    if you look in our WPF sample, you'll see that in the WIndow1() constructor there is this note:

    // Uncomment and add this line when using Autodesk Import/Export methods.
    //Application.Current.Exit += ViewportLayoutEx.OnApplicationExit;


Please sign in to leave a comment.