Método GetPoint
From AutoCAD ActiveX
El método GetString solitita al usuario que designe un punto en la solicitud de comando de AutoCAD. Este método admite dos parámetros, un punto From opcional y la cadena de solicitud. Si se proporciona el punto From, AutoCAD traza una línea elástica desde dicho punto. Para controlar la entrada del usuario, puede anteponerse a este método una llamada al método InitializeUserInput
Obtención de un punto elegido por el usuario
En el ejemplo siguiente se solicita al usuario la selección de dos puntos, inicial y final, para dibujar una línea entre ellos.
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