<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How Identifying User-Set Measurement Units in AutoCAD Architecture for Drawing, Area, Volume, and Angle? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-identifying-user-set-measurement-units-in-autocad/m-p/12777262#M3940</link>
    <description>&lt;P&gt;&lt;SPAN&gt;In AutoCAD Architecture application, users have the flexibility to choose different units for area and volume measurements, such as square feet or cubic meters, independent of the drawing's original units. Now, I need to determine the units set by the user for the drawing, area, volume, and angle measurements programmatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ramesh_choudhari_0-1715849290522.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1363168i5BD14DF010C5165D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ramesh_choudhari_0-1715849290522.png" alt="ramesh_choudhari_0-1715849290522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could someone provide guidance or code snippets on how I can achieve this using the .NET API? Any help would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 08:49:55 GMT</pubDate>
    <dc:creator>ramesh_choudhari</dc:creator>
    <dc:date>2024-05-16T08:49:55Z</dc:date>
    <item>
      <title>How Identifying User-Set Measurement Units in AutoCAD Architecture for Drawing, Area, Volume, and Angle?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-identifying-user-set-measurement-units-in-autocad/m-p/12777262#M3940</link>
      <description>&lt;P&gt;&lt;SPAN&gt;In AutoCAD Architecture application, users have the flexibility to choose different units for area and volume measurements, such as square feet or cubic meters, independent of the drawing's original units. Now, I need to determine the units set by the user for the drawing, area, volume, and angle measurements programmatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ramesh_choudhari_0-1715849290522.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1363168i5BD14DF010C5165D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ramesh_choudhari_0-1715849290522.png" alt="ramesh_choudhari_0-1715849290522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could someone provide guidance or code snippets on how I can achieve this using the .NET API? Any help would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 08:49:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-identifying-user-set-measurement-units-in-autocad/m-p/12777262#M3940</guid>
      <dc:creator>ramesh_choudhari</dc:creator>
      <dc:date>2024-05-16T08:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: How Identifying User-Set Measurement Units in AutoCAD Architecture for Drawing, Area, Volume, and Angle?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-identifying-user-set-measurement-units-in-autocad/m-p/12777489#M3941</link>
      <description>&lt;P&gt;Search for "DrawingSetupVariables".&lt;BR /&gt;Add a reference to AecBaseMgd.dll.&lt;BR /&gt;Autodesk.Aec.ApplicationServices.DrawingSetupVariables: settings saved in the drawing database.&lt;BR /&gt;Autodesk.Aec.Arch.ApplicationServices.ArchDBVariables: architectural object settings.&lt;BR /&gt;&lt;A href="https://www.autodesk.com/autodesk-university/class/What-AutoCADR-ACAMEP-AutoLISPR-Guy-Supposed-Do-2011" target="_blank" rel="noopener"&gt;https://www.autodesk.com/autodesk-university/class/What-AutoCADR-ACAMEP-AutoLISPR-Guy-Supposed-Do-2011&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = HostApplicationServices.WorkingDatabase;
Transaction tr = db.TransactionManager.StartTransaction();

using (tr)
{
    ObjectId objID = AecApp.DrawingSetupVariables.GetInstance(db,false);
    AecApp.DrawingSetupVariables dsv = (AecApp.DrawingSetupVariables)tr.GetObject(objID, OpenMode.ForWrite);
    // drawing units
    String from = dsv.LinearUnit.ToString();
    String to = Autodesk.Aec.BuiltInUnit.Meter.ToString();
    ed.WriteMessage("{0} to {1}.",from, to);
    dsv.LinearUnit = Autodesk.Aec.BuiltInUnit.Meter;
    // drawing scale
    double dblScale = dwgVars.DwgScale;
    // annotation plot size
    double dblPlotSize = dsv.TextHeight;

    tr.Commit();
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;ObjectId idDwgVars = DrawingSetupVariables.GetInstance(database, false);            
DrawingSetupVariables dwgVars = trans.GetObject(idDwgVars, OpenMode.ForRead) as DrawingSetupVariables;
switch (dwgVars.LinearUnit)
{
  case Autodesk.Aec.BuiltInUnit.Inch:
     // .....         
  case Autodesk.Aec.BuiltInUnit.Foot:
     // ...
  case Autodesk.Aec.BuiltInUnit.Millimeter:
     // ...
  case Autodesk.Aec.BuiltInUnit.Centimeter:
     // ...
  case Autodesk.Aec.BuiltInUnit.Decimeter:
    // ...
  case Autodesk.Aec.BuiltInUnit.Meter:
    // ...
  default:
    // ...
}            &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 10:58:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-identifying-user-set-measurement-units-in-autocad/m-p/12777489#M3941</guid>
      <dc:creator>Gepaha</dc:creator>
      <dc:date>2024-05-16T10:58:05Z</dc:date>
    </item>
  </channel>
</rss>

