Retrieving global name of DIMLDRBLK in Localized versions of AutoCAD

<?xml encoding=”UTF-8″>By Balaji Ramamoorthy

When using English version of AutoCAD, you can directly retrieve the name of arrow head using DIMLDRBLK system variable. But when using localized versions of AutoCAD, this system variable will hold the localized name such as “Punkt” in German for DOT arrow head.

To get the global name even in the localized versions, here is a small code snippet to retrieve it :

 Document doc 
 	= Application.DocumentManager.MdiActiveDocument;
 Editor ed = doc.Editor;
 
 <span>using</span><span>  (Transaction tr </span>
 	= doc.TransactionManager.StartTransaction())
 <span>{</span>
     DimStyleTableRecord dstr = db.GetDimstyleData();
     ObjectId dimldrblkId = dstr.Dimldrblk;
     <span>if</span><span>  (!dimldrblkId.IsNull)</span>
     <span>{</span>
         BlockTableRecord btr = tr.GetObject(
 			dimldrblkId, 
 			OpenMode.ForRead) as BlockTableRecord;
         <span>if</span><span>  (btr != null)</span>
         <span>{</span>
             ed.WriteMessage(btr.Name);
         <span>}</span>
     <span>}</span>
     tr.Commit();
 <span>}</span>
 


Comments

3 responses to “Retrieving global name of DIMLDRBLK in Localized versions of AutoCAD”

  1. Hi,
    I thought you might be interested to learn that there’s a first ever AEC application with the Oculus integration in development, and you might want to try it yourself. My team is finalizing the integration now, and we’d be happy to provide you with such an opportunity. The app will allow AEC professionals and their clients to explore building design and construction projects in a truly immersive virtual reality. Please reach me via n.bauman@revizto.com if you’re interested in details.
    Cheers!

  2. What reason for this language-depending naming of DIMLDRBLK variable?

  3. Hi Andrey,
    Sorry, I am not aware of the reason behind it.
    But it could be that the names of the blocks indicate the shape such as DOT, so it might make sense to have them in local language for users to quickly recognize.
    Regards,
    Balaji

Leave a Reply to Andrey BushmanCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading