Error when loading DGN files

Hi,

I was trying to load some DGN files when I noticed only V7 is supported.

I got some DGN v7 and tested them out, but I get an exception.

Here is my code

string filePath = @""; // My Path
CadImage doc = doc = (CadImage)Aspose.CAD.FileFormats.Dgn.DgnImage.Load(filePath);

This is the error:

This are some sample files:SampleFiles.zip (4.0 KB)

The samples are from Autodesk free sample set.

@carlos.molina,
please, try to use

DgnImage doc = doc = (DgnImage)Aspose.CAD.FileFormats.Dgn.DgnImage.Load(filePath);

@oleksii.gorokhovatskyi

I still get an error:

@carlos.molina,
please accept my apologies, this one should be correct:

DgnImage doc = (DgnImage)Aspose.CAD.Image.Load(filePath);

@oleksii.gorokhovatskyi,

I am still getting an error:

I am using version 23.8. Are you using another version where it works for you?

@carlos.molina,
could you please test if this sample works on your side?
SampleApp.zip (232.9 KB)

@oleksii.gorokhovatskyi,

Yes, it works, but can you try using the .NET Framework version and not the .NET Core, please.

My error happens on my .NET Framework example.

@carlos.molina,
please, test the attached sample.
SampleAppFramework.zip (954.1 KB)

@oleksii.gorokhovatskyi,

Thank you so much for the help!!

1 Like

@carlos.molina,
we were happy to help :slight_smile: