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:

  • Point input (mouse clicks, coordinates)
  • Entity selection (single or multiple entities)
  • String, number, angle, and distance input
  • Cursor management and visual feedback

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.

// Get user input for a point
const point = await editor.getPoint();
console.log('User clicked at:', point);

// Get entity selection
const selection = await editor.getSelection();
console.log('Selected entities:', selection.ids);

// Change cursor appearance
editor.setCursor(AcEdCorsorType.Crosshair);

Constructors

Properties

The view this editor is associated with

events: { sysVarChanged: AcCmEventManager<AcDbSysVarEventArgs> } = ...

Editor events

Type declaration

  • sysVarChanged: AcCmEventManager<AcDbSysVarEventArgs>

    Fired after a system variable is changed directly through the SETVAR command or by entering the variable name at the command line.

Accessors

Methods

  • 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.

    Parameters

    Returns Promise<AcGeVector3dLike>

    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).

    Returns Promise<AcGeBox2d>

    Promise that resolves to the selection set containing selected entity IDs

    const selection = await editor.getSelection();
    if (selection.count > 0) {
    console.log(`Selected ${selection.count} entities`);
    // Process the selected entities
    for (const id of selection.ids) {
    // Do something with each selected entity
    }
    }