Table of Contents

CadCommandRegistry

from OpenCAD2D import CadCommandRegistry

class CadCommandRegistry(System.Object) ยท CadCommandRegistry in the .NET reference

The commands a session knows, by name, and the aliases that reach them. CadCommandRegistry.CreateDefault gives the commands of C2 under AutoCAD's names and aliases; a plugin adds its own with CadCommandRegistry.Add.

Constructors

__init__

.NET

def __init__(self) -> None

Makes a registry with no command and AutoCAD's aliases.

Properties and fields

Commands

.NET

@property
def Commands(self) -> System.Collections.Generic.IReadOnlyCollection[CadCommand]

Gets the commands in ordinal order of their names.

Shortcuts

.NET

@property
def Shortcuts(self) -> CadShortcuts
@Shortcuts.setter
def Shortcuts(self, value: CadShortcuts | None) -> None

Gets or sets the aliases and keys; AutoCAD's until replaced, and again when set to null.

Variables

.NET

@property
def Variables(self) -> System.Collections.Generic.IReadOnlyCollection[CadSystemVariable]

Gets the system variables SETVAR knows, and a name typed alone reaches where no command has it, in ordinal order of their names: those of CadCommandRegistry.CreateDefault, kept in the drawing or by the session, and those a window adds.

Methods

Add

.NET

def Add(self, command: CadCommand) -> None

Adds a command, or replaces the one of its name.

AddVariable

.NET

def AddVariable(self, variable: CadSystemVariable) -> None

Adds a system variable, or replaces the one of its name, as the window replaces ORTHOMODE with its status bar's ORTHO.

CreateDefault

.NET

@staticmethod
def CreateDefault() -> CadCommandRegistry

Makes a registry of the commands of C2, under AutoCAD's names: the view, edit and draw commands, SETVAR and the system variables the drawing and the session keep.

Find

.NET

def Find(self, typed: str) -> CadCommand

Finds the command a typed name or alias names, letters of either case the same; a name wins over an alias.

FindVariable

.NET

def FindVariable(self, typed: str) -> CadSystemVariable

Finds the system variable a typed name or alias names, letters of either case the same: LTS names LTSCALE.

Remove

.NET

def Remove(self, name: str) -> bool

Takes a command out.