A fully type-safe TypeScript class providing CAD-style interactive user input using floating HTML input boxes and mouse events. Supports collecting points, distances, angles, numbers, strings, and selecting a 2-point rectangular box using an HTML overlay rectangle (suitable when the main canvas is a THREE.js WebGL canvas).

Constructors

Properties

The view associated with this input operation

Accessors

  • get isActive(): boolean

    The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point selection, distance/angle prompt, string prompt, etc.),

    Returns boolean

Methods

  • Prompt the user to specify a rectangular box by selecting two corners. Each corner may be specified by clicking on the canvas or typing "x,y". A live HTML overlay rectangle previews the box as the user moves the mouse.

    Returns Promise<AcGeBox2d>

  • Prompts the user to select one or more entities by mouse interaction.

    This method supports two selection modes:

    • Click selection: Clicking on an entity selects the entity under the cursor.
    • Box selection: Dragging the mouse to let the user specify a rectangular window, and all entities intersecting that box are selected.

    The selection operation behaves similarly to AutoCAD's Editor.GetSelection() API:

    • Press Enter to accept the current selection set.
    • Press Escape to cancel the operation.
    • If AcEdPromptSelectionOptions.singleOnly is true, the selection completes immediately after the first entity is selected.

    This method does not use floating input boxes. Instead, it relies entirely on mouse gestures and keyboard input. A floating prompt message and command line prompt are displayed during the operation.

    Parameters

    • options: AcEdPromptSelectionOptions

      Selection prompt options that control user messaging and whether only a single entity may be selected.

    Returns Promise<string[]>

    A promise that resolves to an array of selected entity IDs. The array is empty if no entities are selected and the user presses Enter. The promise is rejected if the operation is cancelled.