Using VBA to draw a line using selected points

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm brand new at VBA in AutoCAD and I'm having difficulties finding information on how to do this very basic task.
I would like to draw a line using user picked points. I have that working but because of the way it's programmed it's looking for both points before it draws the line meaning you can not see the line until the command is finished, unlike the native AutoCAD "line" command where you can see where the line will be before you've selected the finish point.
Is there a way to use VBA to draw a line that will look like the native "line" command, IE: show the line and follow the mouse after clicking the first point?
This is my code so far...
Private Sub cmdDraw_Click()
Dim Start As Variant
Dim Finish As Variant
Dim Dline As AcadLine
frmDline.hide
Start = ThisDrawing.Utility.GetPoint(, "select point :")
Finish = ThisDrawing.Utility.GetPoint(, "select point :")
Set Dline = ThisDrawing.ModelSpace.AddLine(Start, Finish)
frmDline.show
End Sub
Thanks in advance.