I am trying to extract all of the annotative scales in a drawing, I have found some code which will extract the current annotative scale, but not all.
Dim doc AsDocument = Application.DocumentManager.MdiActiveDocument
Dim db AsDatabase = doc.Database
Dim ed AsEditor = doc.Editor
Dim ocm AsObjectContextManager = db.ObjectContextManager
Dim occ As ObjectContextCollection = ocm.GetContextCollection("ACDB_ANNOTATIONSCALES")
Thanks inadvanced
Steven Houghton
The code in c# gives me all the Annotative scales defined, and is equal to the number of scales in the "Acad_Scalelist".
Unfortunately i could not found a way to decode the result from Acad_Scalelist.
foreach (DBDictionaryEntry sle in scaleListDict)
{
ed.WriteMessage("\n\t{0}={1}", sle.Key, sle.Value);
var x = tr.GetObject(sle.Value, OpenMode.ForRead);
// Cannot cast from ImpDbObject to AcDbScale or AnnotationScale
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
ed.WriteMessage("\nCurrent AnnotationScale: Name={0}, PaperUnits={1}, DrawingUnits={2}", db.Cannoscale.Name, db.Cannoscale.PaperUnits, db.Cannoscale.DrawingUnits);
ObjectContextManager ocm = db.ObjectContextManager;
ObjectContextCollection occ = ocm.GetContextCollection("ACDB_ANNOTATIONSCALES");
foreach (AnnotationScale asc in occ)
{
ed.WriteMessage("\nAnnScale: Name={0}, PaperUnits={1}, DrawingUnits={2}, Scale={3}", asc.Name, asc.PaperUnits, asc.DrawingUnits, asc.Scale);
}