How do I load DWG/DXF files from a .NET application compiled against AnyCPU?

In order to load DWG/DXF files from a .NET application compiled against AnyCPU, you can use the BitnessAgnostic helper class, to load the Eyeshot x86 or x64 DLL at runtime and instantiate the ReadAutodesk class using reflection. 

The BitnessAgnostic class comes with Eyeshot's code samples, as part of the CustomControls project. To see it in action, simply open one of the Autodesk-related code samples (such as Drafting Demo) and make sure to enable the SETUP compilation symbol.

Was this article helpful?
1 out of 1 found this helpful

Comments

3 comments
Date Votes
  • This dxf import works fine on all computers for me except one... and I can not understand why it does not work on one.

    The crash occurs on "constructor.Invoke(new object[] {@"app8.dwg", null, false, false, false});"

    Is there anyway to understand what can cause the crash inside of the constructor?

    0
  • It looks like we need C++ redist v2019 for Eyeshot v2021. After installing this, it works as expected

    0
  • Yes, from Eyeshot 2021 at least the C++ 2015 Redistributable version is required

    0

Please sign in to leave a comment.

Articles in this section

See more