Prompt for User Input

The Utility object, which is a child of the Document object, defines the user input methods. The user input methods display a prompt on the AutoCAD command line and request input of various types. This type of user input is most useful for interactive input of screen coordinates, entity selection, and short-string or numeric values. If your application requires the input of numerous options or values, a dialog box may be more appropriate than individual prompts.

Each user input method displays a prompt on the AutoCAD command line and returns a value specific to the type of input requested. For example, GetString returns a string, GetPoint returns a variant (which contains a three-element array of doubles), and GetInteger returns an integer value. You can further control the input from the user with the InitializeUserInput method. This method lets you control things such as NULL input (pressing ENTER), input of zero or negative numbers, and input of arbitrary text values.

To force the prompt to be displayed on a line by itself, use the carriage return/linefeed constant (vbCrLf) at the beginning of your prompt strings.