Exception on WW.Cad.IO.DwgReader.Read
Davide
2/8/2019 2:08 PM
|
---|
Hello,
I am using WW.Cad.IO.DwgReader to read cad files and create a simple png preview for a project.
With one file (uploaded as confidential attachment) from an import of 15+ year old customer archive, when reading, the memory grows but never ends. In a vm with reduced resources, this exception is generated:
11:04:34 - Exception of type 'System.OutOfMemoryException' was thrown. - at System.Collections.Generic.List`1.set_Capacity(Int32 value)
at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
at System.Collections.Generic.List`1.Add(T item)
at .()
at ..( )
at ..()
at ..(& , , IList`1 )
at WW.Cad.IO.DwgReader.()
at WW.Cad.IO.DwgReader.Read(DxfModel model)
at WW.Cad.IO.DwgReader.Read()
at WW.Cad.IO.DwgReader.Read(String filename, ProgressEventHandler progressEventHandler)
at WW.Cad.IO.DwgReader.Read(String filename)
at DXApplication13....
|
Wout
2/8/2019 3:05 PM
|
---|
Hi,
The problem has been fixed, please download the latest CadLib version from "Your resources" in your profile.
Thank you for the report!
- Wout
|
Davide
2/11/2019 10:07 AM
|
---|
Thanks for the quick response.
I also report out this exception with same code (dwg in attachment):
System.ArgumentException
HResult=0x80070057
Messaggio=Parametro non valido.
Origine=System.Drawing
Analisi dello stack:
in System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
in System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
in WW.Cad.IO.ImageExporter.CreateBitmap(GDIGraphics3D cadGraphics, SmoothingMode smoothingMode, Matrix4D transform, Color backColor, Int32 width, Int32 height)
in WW.Cad.IO.ImageExporter.CreateAutoSizedBitmap(DxfModel model, GDIGraphics3D cadGraphics, SmoothingMode smoothingMode, Matrix4D transform, Color backColor, Size maxSize)
in WW.Cad.IO.ImageExporter.CreateAutoSizedBitmap(DxfModel model, GDIGraphics3D cadGraphics, Matrix4D transform, Color backColor, Size maxSize)
|
Wout
2/12/2019 11:48 AM
|
---|
Can you please post the code to reproduce the issue?
- Wout
|
Davide
2/13/2019 9:53 AM
|
---|
In https://www.woutware.com/Resources/WW.Cad.4.0 last release is not downlodable.
I resolved this problem (but i don't understand very well why this behavior).
I am doing images for 1000 dwg consecutively, the exception was launched after 400 files, resolved adding a simple Application.DoEvents() after each file (it is a simple windows form application).
C# Code: . |
Wout
2/17/2019 1:45 PM
|
---|
The download problem is fixed by the way.
Also please call Dispose() on the Bitmap after you don't need it anymore. It's safest to just use the C# using statement.
- Wout
|