I have seen this brought up lately at different site.
Would this be the easiest?
Just create a dictionary in the NOD and store the ObjectIds with HardPointerId code?Code - C#: [Select]
[CommandMethod("PurgePrevent")] public void PurgePrevent() { using (Transaction trx = Db.TransactionManager.StartTransaction()) { foreach(ObjectId id in Db.LayerTable()) { } foreach (ObjectId id in Db.BlockTable()) { } Db.NamedObjectDictionary(OpenMode.ForWrite).SetAt("HideDict", dic); dic.SetAt("Ids", xr); trx.AddNewlyCreatedDBObject(xr, true); trx.AddNewlyCreatedDBObject(dic, true); dic.TreatElementsAsHard = true; trx.Commit(); } }
Unless something has changed, I have discovered in the past that this does not prevent the automatic purging of unreferenced anonymous blocks.
Can you confirm this?
Unless something has changed, I have discovered in the past that this does not prevent the automatic purging of unreferenced anonymous blocks.
Can you confirm this?
I have seen this brought up lately at different sites.
Would this be the easiest?
Just create a dictionary in the NOD and store the ObjectIds with HardPointerId code?Code - C#: [Select]
[CommandMethod("PurgePrevent")] public void PurgePrevent() { using (Transaction trx = Db.TransactionManager.StartTransaction()) { foreach(ObjectId id in Db.LayerTable()) { } foreach (ObjectId id in Db.BlockTable()) { } Db.NamedObjectDictionary(OpenMode.ForWrite).SetAt("HideDict", dic); dic.SetAt("Ids", xr); trx.AddNewlyCreatedDBObject(xr, true); trx.AddNewlyCreatedDBObject(dic, true); dic.TreatElementsAsHard = true; trx.Commit(); } }