Before deleting dimension style, best judge there is not marked on the map objects are using that style, if any, do not delete the text style
c # code as follows:
private void DelDimStyle() { string txt = textBox2.Text; Database MxDrawDatabase = (MxDrawDatabase) axMxDrawX1.GetDatabase (); // returns the style sheet object database IMxDrawDimStyleTable DimStyleTable = database.GetDimStyleTable (); // get the exemplar pattern style object IMxDrawDimStyleTableRecord DimStyleRec = DimStyleTable.GetAt (TXT, to false ); IF (DimStyleRec == null ) return ; // delete the object DimStyleRec.Erase (); MessageBox.Show ( " successfully deleted dimension style " ); }
Show results: