提示用户输入
 
 

The Editor 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 or in a dynamic input tooltip, 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 Windows form may be more appropriate than individual prompts.

Editor 对象是 Document 对象的子对象,定义了用户输入方法。用户输入方法在 AutoCAD 命令行中或动态输入工具提示中显示一个提示信息,并且要求输入各种不同类型的值。这种用户输入对于交互式输入屏幕坐标、图元选择、短字符串或数值非常有用。如果应用程序要求输入多个选项或值,则使用 Windows 窗体可能比使用单个提示更合适。

Each user input method displays an optional prompt on the command line and returns a value specific to the type of input requested. For example, GetString returns a PromptResult which allows you to determine the status of the GetString method and retrieve the string the user entered. Each one of the user input methods has a specific return value.

每个用户输入方法都在 AutoCAD 命令行显示提示,并返回特定于所请求的输入类型的值。例如,GetString 返回一个 PromptResult,它允许用户判断 GetString 方法的状态并获得用户输入的字符串。每一个用户输入方法都有一个指定的返回值。

The input methods accept a string for the prompt message to be displayed or a specific object type which controls the input from the user. These object types let you control things such as NULL input (pressing Enter), base point, input of zero or negative numbers, and input of arbitrary text values.

输入方法接受一个用于显示提示的字符串或控制用户输入的指定对象类型。这些对象类型让用户可以控制一些输入,像输入 NULL(按回车),基点,输入零或负数,任意文本值的输入。

To force the prompt to be displayed on a line by itself, use the carriage return/linefeed constant (vbCrLf) or linefeed constant (vbLf) at the beginning of your prompt strings when using VB.NET, or "\n" with strings in C#.

要使提示单独显示在一行中,在VB.NET中使用可以在提示字符串的开头使用回车符/换行常量字符 (vbCrLf),而在 C# 中使用 “\n” 字符串。