Creates a write-enabled LAYDEL command instance.
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.
The global command name
Sets the global (untranslated) name of the command.
The global command name (e.g., 'LINE', 'CIRCLE', 'ZOOM')
Gets the local (translated) name of the command.
The local name is displayed to users and should be localized to the current language/region.
The localized command name
Sets the local (translated) name of the command.
The localized command name (e.g., 'Draw Line', 'Zoom In')
Gets the minimum access mode required to execute this command.
Commands with higher mode requirements can only be executed when the document is opened in a compatible mode. Higher value modes are compatible with lower value modes.
The minimum access mode required
Sets the minimum access mode required to execute this command.
The minimum access mode (Read, Review, or Write)
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:
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.
Runs the interactive layer deletion workflow until the user cancels.
The command supports both entity-based and name-based deletion paths and keeps an in-memory undo history for the current command session only.
Active application context used to inspect and mutate the drawing.
Resolves when the command loop ends.
ProtectedonCalled after the command has finished executing.
This lifecycle hook is intended for cleanup or follow-up logic, such as:
The default implementation does nothing.
The current application context
ProtectedonCalled right before the command starts executing.
This lifecycle hook is intended for subclasses that need to perform
setup work before execute() runs, such as:
The default implementation does nothing.
The current application context
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:
commandWillStart eventexecute() methodcommandEnded eventThe current application context containing view and document
AutoCAD-like
LAYDELcommand.Supported workflows:
Namebranch to delete a layer by name.Undoto restore the most recently deleted layer in the current command session.