title: How to create a simple AutoCad 2017 dimension from .NET?
body: <p>I'm starting in AutoCAD 2017 development with .NET and I created a basic rectangle with the next code:</p>
  
  <pre><code>[CommandMethod("AddSimpleRectangle")]
  public static void AddSimpleRectangle()
  {
      var acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
      acDoc.LockDocument();
      var acCurDb = acDoc.Database;
      var pr = acDoc.Editor.GetPoint("\nEnter insertion point: ");
      if (pr.Status != PromptStatus.OK)
         return;
  
      using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
      {
          var acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
                                           OpenMode.ForRead) as BlockTable;
  
          var acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],
                                           OpenMode.ForWrite) as BlockTableRecord;
  
          using (var acPoly = new Polyline())
          {
              acPoly.AddVertexAt(0, new Point2d(pr.Value.X, pr.Value.Y), 0, 10, 10);
              acPoly.AddVertexAt(1, new Point2d(pr.Value.X + 2000, pr.Value.Y), 0, 10, 10);
              acPoly.AddVertexAt(2, new Point2d(pr.Value.X + 2000, pr.Value.Y + 500), 0, 10, 10);
              acPoly.AddVertexAt(3, new Point2d(pr.Value.X, pr.Value.Y + 500), 0, 10, 10);
              acPoly.Closed = true;
              acPoly.Color = Autodesk.AutoCAD.Colors.Color.FromRgb(0, 125, 255);
  
              acBlkTblRec.AppendEntity(acPoly);
              acTrans.AddNewlyCreatedDBObject(acPoly, true);
          }
          acTrans.Commit();
      }
  }
  </code></pre>
  
  <p>Now, I need to append a Dimension at (let's say) one side to show the height.
  How can this be done from .NET?
  Thanks!</p>