MLightCAD
    Preparing search index...

    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);
    Index

    Constructors

    Properties

    The view this editor is associated with

    events: {
        commandEnded: AcCmEventManager<AcEdCommandEventArgs>;
        commandWillStart: AcCmEventManager<AcEdCommandEventArgs>;
        sysVarChanged: AcCmEventManager<AcDbSysVarEventArgs>;
    } = ...

    Editor events

    Type Declaration

    • commandEnded: AcCmEventManager<AcEdCommandEventArgs>

      Fired after the command finishes executing

    • commandWillStart: AcCmEventManager<AcEdCommandEventArgs>

      Fired just before the command starts executing

    • 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

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

      Type Parameters

      • T

      Parameters

      • cursorType: AcEdCorsorType

        The cursor type to use temporarily

      • action: () => T | Promise<T>

        The function to execute with the temporary cursor

      Returns Promise<T>

      The result of the executed function

      // Temporarily set grab cursor for a pan operation
      await editor.withCursor(AcEdCorsorType.Grab, async () => {
      // Perform pan operation
      await this.performPan();
      });
      // Cursor is automatically restored to previous state