NULL reference exception loading PLT
Moderators: SDS, support, admin
NULL reference exception loading PLT
The code is fairly straightforward:
CADImage img = new HPGL2.HPGLImage();
img.LoadFromFile(mypltfilename);
Error is: Object reference not set to an instance of an object.
CADImport.dll!..(System.Drawing.Color = "{Name=ff000000, ARGB=(255, 0, 0, 0)}", CADImport.CADLineType = null) + 0x6c bytes
CADImport.dll!..(CADImport.CADEntity = {CADImport.CADPolyLine}) + 0xd0 bytes
CADImport.dll!..() + 0x1057 bytes
CADImport.dll!..(ushort = 20549) + 0x366 bytes
CADImport.dll!..(string = "68.PLT") + 0x208 bytes
CADImport.dll!CADImport.HPGL2.HPGLImage.LoadFromFile(string path = "68.PLT") + 0x58 bytes
If I load this same PLT file into the viewer, or the EditorDemo application, it loads just fine. The same code loading a different filetype, such as a DWG using DWGImage() also loads just fine.
CADImage img = new HPGL2.HPGLImage();
img.LoadFromFile(mypltfilename);
Error is: Object reference not set to an instance of an object.
CADImport.dll!..(System.Drawing.Color = "{Name=ff000000, ARGB=(255, 0, 0, 0)}", CADImport.CADLineType = null) + 0x6c bytes
CADImport.dll!..(CADImport.CADEntity = {CADImport.CADPolyLine}) + 0xd0 bytes
CADImport.dll!..() + 0x1057 bytes
CADImport.dll!..(ushort = 20549) + 0x366 bytes
CADImport.dll!..(string = "68.PLT") + 0x208 bytes
CADImport.dll!CADImport.HPGL2.HPGLImage.LoadFromFile(string path = "68.PLT") + 0x58 bytes
If I load this same PLT file into the viewer, or the EditorDemo application, it loads just fine. The same code loading a different filetype, such as a DWG using DWGImage() also loads just fine.
Re: NULL reference exception loading PLT
Hello!
We recommend to use the following code (it is based on Viewer demo):
Sergey.
We recommend to use the following code (it is based on Viewer demo):
Code: Select all
this.cadImage = CADImage.CreateImageByExtension(@"c:\Test.plt");
cadImage.LoadFromFile(@"c:\Test.plt");
this.cadPictBox.Invalidate();
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: NULL reference exception loading PLT
Same result. Furthermore, I'm not using a picturebox at all. Just the CADImage() object.
Re: NULL reference exception loading PLT
Please try the following code:
If this not help, please send us your PLT file to support@cadsofttools.com with a reference to this topic. We need to test your file.
Sergey.
Code: Select all
CADImport.HPGL2.HPGLImage img = new CADImport.HPGL2.HPGLImage();
img.LoadFromFile(@"c:\Test.plt");
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support