Creates a new editor instance for the specified view.
The view that this editor will handle input for
Protected_viewThe view this editor is associated with
ReadonlyeventsEditor events
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.),
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 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 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 crossing, right-to-left for window).
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.
Restores the previously set cursor.
This is useful for temporarily changing the cursor and then reverting to the previous state.
Sets the cursor appearance for the view.
The previous cursor type is stored for potential restoration.
The cursor type to set
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