I have a very weird problem with DxfDocument.Load().
It is working fine most of the time loading a DXF file from the file opening dialog.
But for some drawings, such as the attached file, which is a very simple drawing with just a circle and a few arcs, the function returns Null, which create exceptions when trying to process the dxf object later on.
What is more weird, with that DXF file, using the same software I wrote, the software installed on one particular machine also fails at first (returns Null upon calling the function) but after several tries it works as it should. On all the other machine, it
just doesn't work.
I am not sure its a problem with the library or Windows.
Any help is greatly appreciated.
This is my code:
if (openFileDialog2.ShowDialog() == DialogResult.Cancel) return;
if (!File.Exists(openFileDialog2.FileName)) return;
dxf = DxfDocument.Load(openFileDialog2.FileName);
panelCanvas.Invalidate(); //clear the canvas
isFileLoaded = true;
catch (Exception err)
MessageBox.Show("Error opening file: " + err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
//List major types of supported objects in the file
lblLines.Text = dxf.Lines.Count.ToString();
UPDATE: I TRIED THE DEBUG BUILD OF THE LIBRARY AND IT IS WORKING FINE, ALSO NO EXCEPTIONS ARE CAUGHT. WHAT COULD BE THE ISSUE?