Table of Contents

CadCommand

from OpenCAD2D import CadCommand

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

A command, as AutoCAD's: a name and the few lines that ask its prompts in turn and make its edit. The body is an iterator that yields each prompt and reads the answer from CadCommandContext.Input when it is resumed, so that a command reads top to bottom as its prompts do, and a CadCommandSession drives it from the command line, the canvas or a test alike.

Constructors

__init__

.NET

def __init__(
    self,
    name: str,
    body: System.Func[CadCommandContext, System.Collections.Generic.IEnumerable[CadPrompt]],
    usesSelection: bool = ...,
) -> None

Makes a command.

Properties and fields

Body

.NET

@property
def Body(self) -> System.Func[CadCommandContext, System.Collections.Generic.IEnumerable[CadPrompt]]

Gets the body.

Name

.NET

@property
def Name(self) -> str

Gets the name, in capitals.

UsesSelection

.NET

@property
def UsesSelection(self) -> bool

Gets whether the command takes the objects selected before it was started.

Methods

ToString

.NET

def ToString(self) -> str