title: How to insert or create line in Autocad *.dxf drawing with VB.NET?
body: <p>I'm programming on VBA for Autocad but until this day I can't found how to create or insert line on VB.NET.</p>
  
  <p>I see that VB.NET have two kinds of concepts to use the acad files. </p>
  
  <ol>
  <li><p>Using: <code>AcApplication.DocumentManager.MdiActiveDocument</code>;</p></li>
  <li><p>Using some like this, as transaction for more than one file all files of folders are declared as database and the block table and modifications as transactions, maybe I'm a little lost on the concepts but I'm new in VB.NET</p></li>
  </ol>
  
  <p>I'm need a sample of how to create line or circle on VB.NET and insert on DXF drawing using the concept 2 as database because I need to modify a lot of drawings.</p>
  
  <pre><code>For Each Filedxf As IO.FileInfo In Modfiles 
  Try 
      Change = False 
      Dim MyDB As New Database(False, True) 
      MyDB.DxfIn(Filedxf.FullName.ToString, IO.Path.Combine(PathToChange, "dxf.log")) 
      Using MyTrans As Transaction = MyDB.TransactionManager.StartTransaction 
          Dim MyBT As BlockTable = MyDB.BlockTableId.GetObject(OpenMode.ForRead) 
          For Each MyBTRId As ObjectId In MyBT 
              Dim MyBTR As BlockTableRecord = MyBTRId.GetObject(OpenMode.ForRead) 
              For Each cadID As ObjectId In MyBTR 
                  Select Case cadID.ObjectClass.DxfName.ToUpper 
                      Case "TEXT" 
                          Dim MyText As DBText = cadID.GetObject(OpenMode.ForWrite) 
                          Select Case MyText.Layer.ToUpper
  </code></pre>
  
  <p>Thanks a lot for your help</p>