Issue
When I calculate the extents of entities in a drawing, for some entities an exception is thrown with the "eNullExtents" message. What is wrong?
Solution
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:
Extents3d extents;
try
{
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...
}
else
// something is wrong ...
TODO!
}