cart: empty [ Login ]

GetBounds Object reference not set to an instance of object

1 
jjohnson2
4/29/2022 8:22 PM
Hi, I'm getting an exception when calculating bounds of some DWG files. The exception thrown seems related to LEADER entities within the drawings. However, I've tried programmatically removing those entities from model prior to bounds calculation or SVGExporter.Draw and I'm still getting the same exception in both places. Stacktrace:
Code:
Message "Object reference not set to an instance of an object." string at WW.Cad.Model.Entities.DxfMLeader.DrawInternal(Wireframe context, IWireframeGraphicsFactory graphicsFactory)
I've attached the two offending .DWG files as well as a small console app for which to replicate the issue. Which I will also paste below:
C# Code:
using WW.Cad.Drawing; using WW.Cad.IO; using WW.Cad.Model; using WW.Math; string cadLibLicense = "licensestring"; WW.WWLicense.SetLicense(cadLibLicense); DxfModel model; using (Stream file = File.OpenRead("./dwg1.dwg")) { model = DwgReader.Read(stream: file); } BoundsCalculator boundsCalculator = new BoundsCalculator(); boundsCalculator.GetBounds(model); Bounds3D bounds = boundsCalculator.Bounds;
Library Version: NetStandard.1.0.0-rc70
Wout
5/3/2022 9:27 AM
Hi, Please download the latest version (rc72), I've just fixed the issue. Also please update to version 6.0, because this is the last update to the .NET standard version of CadLib. There have been breaking changes in the latest SixLabors drawing library unfortunately, so it's too cumbersome to maintain all these versions side by side. Thank you for the report. - Wout
1