// Search the parameter for references to the referencedId: public void Find(DBObject obj) { this.current = obj; try { obj.DwgOut(this); } finally { this.current = null; } }
public static ReferenceFilerResult GetReferences([NotNull] this DBObject dbo) { var filer = new ReferenceFiler(); dbo.DwgOut(filer); return(new ReferenceFilerResult { HardOwnershipIds = filer.HardOwnershipIds, HardPointerIds = filer.HardPointerIds, SoftOwnershipIds = filer.SoftOwnershipIds, SoftPointerIds = filer.SoftPointerIds }); }
// Erase the anonymous blocks referenced by an object private static void EraseReferencedAnonBlocks( Transaction tr, DBObject obj ) { var refFiler = new ReferenceFiler(); obj.DwgOut(refFiler); // Loop through the references and erase any // anonymous block definitions // foreach (ObjectId refid in refFiler.HardPointerIds) { BlockTableRecord btr = tr.GetObject(refid, OpenMode.ForRead) as BlockTableRecord; if (btr != null && btr.IsAnonymous) { btr.UpgradeOpen(); btr.Erase(); } } }