ACadSharp icon indicating copy to clipboard operation
ACadSharp copied to clipboard

Throws error "Version not recognized"

Open donnyv opened this issue 1 year ago • 1 comments

Describe the bug Throws error "Version not recognized" Loads fine in TrueView

To Reproduce Try to load attached file

Expected behavior To load the dxf successfully

1352_000_01.zip

donnyv avatar Oct 24 '24 13:10 donnyv

Hi @donnyv

I've tested the file and seems to work fine, which version are you using?

DomCR avatar Oct 24 '24 15:10 DomCR

I just tried the newest version with this file. 0720_003.zip

Keep getting this error. image

ACadSharp.Exceptions.CadNotSupportedException
  HResult=0x80131515
  Message=File version not recognised
  Source=ACadSharp
  StackTrace:
   at ACadSharp.IO.DWG.DwgFileHeader.CreateFileHeader(ACadVersion version)
   at ACadSharp.IO.DwgReader.readFileHeader()
   at ACadSharp.IO.DwgReader.Read()
   at ACadSharp.IO.DwgReader.Read(String filename, DwgReaderConfiguration configuration, NotificationEventHandler notification)
   at ACadSharp.IO.DwgReader.Read(String filename, NotificationEventHandler notification)
   at AcadSharpTest.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\dvela\source\repos\AcadSharpTest\AcadSharpTest\Form1.cs:line 19
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

I know this dxf works because I used netDxf to open it and read all the line work out of it.

Does this library have a dependency that I'm missing?

This the basic project I used to try to open it. AcadSharpTest.zip

donnyv avatar Dec 04 '24 17:12 donnyv

Hi @donnyv,

You are using the DwgReader for a dxf file, please try to use DxfReader instead.

Hope this helps.

DomCR avatar Dec 05 '24 07:12 DomCR

I can't believe I did such a noob move 😞

Thanks 👍

donnyv avatar Dec 05 '24 12:12 donnyv