by Fenton Webb
Here’s some code which shows how to list all of the Annotation Styles inside of a P&ID drawing…
// create Annotation by Fenton Webb, DevTech, Autodesk 1/5/2012
[CommandMethod("listAllAnnotationStyles")]
public void listAllAnnotationStyles()
{
// get the AutoCAD Editor object
Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;
// list the entries in the Autodesk_PNP dict
using (DBDictionary annoStylesDict = DictionaryUtils.GetAnnotationStylesDictionaryId(ed.Document.Database, 0).Open(OpenMode.ForRead) as DBDictionary)
foreach(DBDictionaryEntry entry in annoStylesDict)
ed.WriteMessage("\n" + entry.Key);
}
