GetPoint Method
From AutoCAD ActiveX
The GetPoint method prompts the user for the specification of a point at the AutoCAD Command prompt. This method accepts two parameters, an optional from point and the prompt string. If the from point is provided, AutoCAD draws a rubber-band line from that point. To control the user input, this method can be preceded by a call to the InitializeUserInput method.
Get a point selected by the user
The following example prompts the user for two points, then draws a line using those points as the start point and endpoint.
Sub Ch3_GetPointsFromUser()
Dim startPnt As Variant
Dim endPnt As Variant
Dim prompt1 As String
Dim prompt2 As String
prompt1 = vbCrLf & "Enter the start point of the line: "prompt2 = vbCrLf & "Enter the end point of the line: "' Get the first point without entering a base pointstartPnt = ThisDrawing.Utility.GetPoint(, prompt1)' Use the point entered above as the base pointendPnt = ThisDrawing.Utility.GetPoint(startPnt, prompt2)' Create a line using the two points enteredThisDrawing.ModelSpace.AddLine startPnt, endPntThisDrawing.Application.ZoomAllEnd Sub