I have issue with blocks.
I delete blocks like this:
//Find block with similar name and delete them all
List<int> deleteId = new List<int>();
foreach (Rhino.DocObjects.InstanceDefinition idef in Rhino.RhinoDoc.ActiveDoc.InstanceDefinitions)
if (idef.Name.Length > blockName.Length)
if (idef.Name.Substring(0, blockName.Length) == blockName)
foreach (int i in deleteId)
Rhino.RhinoDoc.ActiveDoc.InstanceDefinitions.Delete(i, true, true);
They do not appear on the screen anymore but when I count total instance of the objects they are somewhere in the document as this number is increasing. I do not see any blocks on block manager, but guids of them appears.
How to delete blocks correctly?
I tried manually purge all objects. But still the number is increasing. Let say I have totally 30 intances in doucument.
First time there are 30 , I delete them nothing on the screen but counter says there is 60 after I place new blocks, then 90 , 120 ... to whatever big number.