Creates a new editor instance for the specified view.
The view that this editor will handle input for
Protected_The view this editor is associated with
ReadonlyeventsEditor events
Fired after the command finishes executing
Fired just before the command starts executing
Fired after a system variable is changed directly through the SETVAR command or by entering the variable name at the command line.
Gets the currently active cursor type.
The current cursor type, or undefined if none is set
The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point selection, distance/angle prompt, string prompt, etc.),
Whether the current input session explicitly allows entity selection.
Clears any queued scripted inputs.
Consumes and returns the next queued scripted input.
Queues scripted command-line inputs for subsequent getXXX prompts. One entry equals one Enter-confirmed input.
Prompts the user to input an angle by clicking on the view or input one number.
This method returns a promise that resolves after the user clicks on the view or inputs one valid angle value.
Promise that resolves to the input angle value.
Prompts the user to specify a rectangular bounding box (two corners).
Promise that resolves to rectangular bounding box.
Prompts the user to input a distance by clicking on the view or input one number.
This method returns a promise that resolves after the user clicks on the view or inputs one valid distance value.
Promise that resolves to the input distance value.
Prompts the user to input a double value.
Promise that resolves to the input double value.
Prompts the user to input a keyword.
Promise that resolves to the input one keyword.
Current modifier key state (Ctrl/Shift/Alt/Meta) during input sessions.
Toggle-style input states (e.g. Ctrl-press flip) during input sessions.
Prompts the user to input an integer value.
Promise that resolves to the input integer value.
Prompts the user to input a keyword.
Promise that resolves to the input one keyword.
Prompts the user to input a point by clicking on the view or inputting one coordinate value.
This method returns a promise that resolves after the user clicks on the view or inputs one valid coordinate value, providing the world coordinates of the click point.
Promise that resolves to the input point coordinates
Prompts the user to select entities using box selection.
This method allows the user to drag a selection box to select multiple entities at once. The selection behavior follows CAD conventions (left-to-right for window, right-to-left for crossing).
Promise that resolves to the selection set containing selected entity IDs
Prompts the user to input a string.
Promise that resolves to the input one string.
Returns the next queued scripted input without consuming it.
Reset toggle-style inputs to their default state.
Restores the previously set cursor.
This is useful for temporarily changing the cursor and then reverting to the previous state.
Selects all objects in model space that satisfy the specified filter.
This method is analogous to AutoCAD .NET Editor.SelectAll(SelectionFilter),
but it does not modify the current view selection set directly. Instead, it
returns an independent AcEdPromptSelectionResult.
Optionalfilter: AcEdSelectionFilterOptional typed-value filter expression
Selection result containing all matched object ids
Sets the cursor appearance for the view.
The previous cursor type is stored for potential restoration.
The cursor type to set
Sets the cursor color for the crosshair cursor
The color for the cursor
Displays a typed message in the command-line message panel.
Message text to render
Message severity controlling the rendered style
OptionalmsgKey: stringOptional localization key associated with the message
Temporarily sets a new cursor for the duration of a function execution.
This method saves the current cursor, sets the new cursor, executes the provided function, and then restores the original cursor regardless of whether the function succeeds or fails.
The cursor type to use temporarily
The function to execute with the temporary cursor
The result of the executed function
Advanced input handler for CAD operations providing high-level user interaction methods.
This class serves as a wrapper for all types of user input including:
The editor abstracts away low-level mouse and keyboard events, providing a clean API for command implementations. Instead of listening to raw DOM events, commands should use the methods provided by this class.
Example