List of MLine Styles

List of MLine Styles

xaotix
Enthusiast Enthusiast
1,068 Views
2 Replies
Message 1 of 3

List of MLine Styles

xaotix
Enthusiast
Enthusiast

How can I get the list of loaded mline styles at specific drawing?

0 Likes
Accepted solutions (2)
1,069 Views
2 Replies
Replies (2)
Message 2 of 3

Norman_Yuan
Mentor
Mentor
Accepted solution

You open MLStyleDictionary via Database.MLStyleDictinaryId, and loop through each DBDictionaryEntry, the key of the entry is the MLStyle's name.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

xaotix
Enthusiast
Enthusiast
Accepted solution
 using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
            {
                DBDictionary acLyrTbl;
                acLyrTbl = acTrans.GetObject(acCurDb.MLStyleDictionaryId,
                                             OpenMode.ForRead) as DBDictionary;

                foreach (var acObjId in acLyrTbl)
                {
                    MlineStyle acLyrTblRec;
                    acLyrTblRec = acTrans.GetObject(acObjId.Value,
                                                    OpenMode.ForRead) as MlineStyle;

                    acDoc.Editor.WriteMessage("\n" + acLyrTblRec.Name);
                }

            }
0 Likes