I am using MicroStation V8i
This is a windows executable
void Remove_Element(string sPath, int iLevel) { MicroStationDGN.Application app = new MicroStationDGN.Application(); DesignFile dgnfile = app.OpenDesignFile(sPath, false, MsdV7Action.msdV7ActionUpgradeToV8); ElementScanCriteria _MSesc = new ElementScanCriteria(); _MSesc.ExcludeAllTypes(); _MSesc.IncludeType(MsdElementType.msdElementTypeText); _MSesc.IncludeType(MsdElementType.msdElementTypeLine); _MSesc.ExcludeAllLevels(); _MSesc.IncludeLevel(app.ActiveModelReference.Levels.FindByNumber(iLevel)); _Element Objectt; ElementEnumerator ele = app.ActiveModelReference.Scan(_MSesc); while (ele.MoveNext()) { Objectt = ele.Current; Objectt.ModelReference.RemoveElement(ele.Current); } dgnfile.Save(); dgnfile.Close(); }
i want to delete the element but i can't, the elements are not removed