MLightCAD
    Preparing search index...

    AutoCAD-like LAYISO command.

    The command isolates the layers of selected objects. Non-isolated layers are either turned off or locked, depending on the persisted Settings choice.

    Current viewer limitations:

    • Per-viewport layer freezing is not represented, so Vpfreeze falls back to global layer-off behavior.
    • Locked-layer fading is not rendered, so Lock and fade falls back to locking non-isolated layers without changing their visibility.

    Hierarchy

    • AcApLayerMutationCmd
      • AcApLayerIsoCmd
    Index

    Constructors

    Properties

    recordsUndoStack: boolean = true

    When false, this command does not create its own undo record.

    Accessors

    • get globalName(): string

      Gets the global (untranslated) name of the command.

      The global name is typically used for programmatic access and should remain consistent across different language localizations.

      Returns string

      The global command name

    • set globalName(value: string): void

      Sets the global (untranslated) name of the command.

      Parameters

      • value: string

        The global command name (e.g., 'LINE', 'CIRCLE', 'ZOOM')

      Returns void

    • get userData(): TUserData

      Gets the custom user-defined data associated with this command.

      userData is a generic, strongly-typed container that allows consumers of the command to attach arbitrary metadata without modifying the command class itself.

      The shape of userData is defined by the generic parameter TUserData when the command is declared:

      Returns TUserData

      The user-defined data object associated with this command

      interface MyCommandData {
      sourceLayerId: string
      isPreview: boolean
      }

      class MyCommand extends AcEdCommand<MyCommandData> {}

      const cmd = new MyCommand()
      cmd.userData.sourceLayerId = 'Layer-01'
      cmd.userData.isPreview = true

      This design provides flexibility similar to THREE.Object3D.userData while preserving full compile-time type safety.

    Methods

    • Runs the isolate-layer workflow.

      Preselected entities are consumed immediately. Otherwise the command keeps prompting until the user either changes settings, selects objects, or cancels the command.

      Parameters

      • context: AcApContext

        Active application context used to update layer states.

      Returns Promise<void>

      Resolves when layer isolation is applied or the command exits.

    • Called after the command has finished executing.

      This lifecycle hook is intended for cleanup or follow-up logic, such as:

      • Releasing resources
      • Resetting editor state
      • Finalizing transactions

      The default implementation does nothing.

      Parameters

      Returns void

    • Called right before the command starts executing.

      This lifecycle hook is intended for subclasses that need to perform setup work before execute() runs, such as:

      • Initializing temporary state
      • Locking resources
      • Preparing UI or editor state

      The default implementation does nothing.

      Parameters

      Returns void

    • Shows the application busy overlay while a long-running operation executes.

      Parameters

      • Optionalmessage: string

        Optional message displayed under the spinner

      Returns void

    • Triggers the command execution with proper event handling.

      This method should not be overridden by subclasses as it handles the event notification workflow. Subclasses should implement the execute() method instead.

      The execution flow:

      1. Fires commandWillStart event
      2. Calls the execute() method
      3. Fires commandEnded event

      Parameters

      • context: AcApContext

        The current application context containing view and document

      Returns Promise<void>

      const command = new MyCommand();
      command.trigger(docManager.context);
    • Runs work while the application busy overlay is visible.

      Type Parameters

      • T

      Parameters

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

        Synchronous or asynchronous operation to execute

      • Optionalmessage: string

        Optional message displayed under the spinner

      Returns Promise<T>