The DimStyleTable class is a symbol table that contains all dimension style definitions in an AutoCAD drawing.
Autodesk.AutoCAD.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ SymbolTable
└─ DimStyleTable
| Method | Return Type | Description |
|---|---|---|
Has(string) |
bool |
Checks if a dimension style exists by name |
this[string] |
ObjectId |
Gets dimension style ObjectId by name (indexer) |
using (Transaction tr = db.TransactionManager.StartTransaction())
{
DimStyleTable dst = tr.GetObject(db.DimStyleTableId, OpenMode.ForRead) as DimStyleTable;
ed.WriteMessage("\nDimension styles in drawing:");
foreach (ObjectId styleId in dst)
{
DimStyleTableRecord dstr = tr.GetObject(styleId, OpenMode.ForRead) as DimStyleTableRecord;
ed.WriteMessage($"\n {dstr.Name}");
}
tr.Commit();
}