title: VBA AutoCAD: drawing polyline from two given points and following a specific path
body: <p>I'm trying to draw a polyline from two given points and following a specific path (another polyline) otherwise the 2 polylines will be superimposed with VBA AutoCAD or qgis</p>
  
  <p><a href="https://i.stack.imgur.com/9Q4Ae.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Q4Ae.png" alt="screenshot"></a></p>
  
  <pre><code>Sub draw_polyline1()
      Dim lineobj As AcadLine
      Dim entite As AcadEntity 
      Dim ptd As Variant
      Dim pta As Variant
  
      ThisDrawing.Utility.GetEntity entite, ptClique, "select the path to follow" 
      ptd = ThisDrawing.Utility.GetPoint(, "select the start point")
      pta = ThisDrawing.Utility.GetPoint(, "select the end point")
      Set lineobj = ThisDrawing.ModelSpace.AddPolyline(entite, ptd, pta) 
      ZoomExtents 
  End Sub
  </code></pre>
  
  <p>The blue line is the path and the red one is the polyline that I want to draw automatically between the 2 points(the stars in the schema)</p>