Author Topic: Annotative Dimension detection ?  (Read 1811 times)

0 Members and 1 Guest are viewing this topic.

Spike Wilbury

  • Guest
Annotative Dimension detection ?
« on: August 19, 2009, 05:04:38 PM »
I am doing some isometric dimension styles (including the text styles), and want simple to detect if the current or any other dimension style it is annotative...

am not going to work using these type of annotative dims, and also it is the first time that i end up worried about them.

any lead to where to look for?


Thanks!

Spike Wilbury

  • Guest
Re: Annotative Dimension detection ?
« Reply #1 on: August 19, 2009, 07:11:19 PM »
Was actually simple :)

Code: [Select]
#region TestDimStyle

        [CommandMethod("TestDimStyle")]
        public static void testDimStyle()
        {
            Document doc = AcadApp.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            Database db = doc.Database;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                DimStyleTable dst;
                dst = tr.GetObject(db.DimStyleTableId, OpenMode.ForRead) as DimStyleTable;
                string dimName = "Standard"; // "Annotative";
                if (dst.Has(dimName) == true)
                {
                    DimStyleTableRecord dstr;
                    dstr = tr.GetObject(dst[dimName], OpenMode.ForRead) as DimStyleTableRecord;
                    if (dstr.Annotative == AnnotativeStates.True)
                        ed.WriteMessage("\nDimension style is annotative!");
                    else
                        ed.WriteMessage("\nDimension style is not annotative!");
                }
                tr.Commit();
            }
        }

#endregion