When I calculate the extents of entities in a drawing, for some entities an exception is thrown with the "eNullExtents" message. What is wrong?
This exception occurs for an insert of an empty block or for an empty block attribute. It is "as designed", it's just a notification to the developer about an empty object. An easy solution is to add a separate catch block for this particular exception:
extents = pEntity.GeometricExtents;
catch (Autodesk.AutoCAD.Runtime.Exception ex)
if (ex.Message == "eNullExtents")
// The entity is empty and has no extents
// TODO. We can simply skip this entity...
// something is wrong ...