MLightCAD
    Preparing search index...

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

    Index

    Constructors

    Properties

    The view associated with this input operation

    Accessors

    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.

      The box prompt is implemented as two chained point prompts. Keywords from the original box prompt are copied into each corner prompt so the caller sees a consistent interaction model across both stages.

      Parameters

      • options: AcEdPromptBoxOptions

        Box prompt options controlling corner messages, preview behavior, and keywords

      Returns Promise<AcEdPromptBoxResult>

      A prompt result containing the final 2D box, cancel status, or keyword

    • 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:
        • left-to-right drag: window selection (entities fully inside the box)
        • right-to-left drag: crossing selection (entities intersecting the box)

      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<AcEdPromptSelectionResult>

      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.