可以根據需要,刪除不需要的實例。
Transaction tr = new Transaction(doc, "DelecteInstance");
tr.Start();
foreach (Element e in collection)
{
if (e != null && !InstanceMatch(e, sel))
{
doc.Delete(e.Id);
}
}
tr.Commit();
設置一些條件,利用實例的Id進行刪除實例的操作。