Hi there,
I get a null object ID sometimes in the PurgeLinetypesReferencedNotByAnonBlock Method. The following if clause can fix this:
[...]
// If the owner does not belong to an anonymous
// block, then we take it seriously as a reference
//
// Chek the OwnerId first!
if (ent.OwnerId != ObjectId.Null)
{
var owner = (BlockTableRecord)tr.GetObject(ent.OwnerId, OpenMode.ForRead);
[...]