CadRemoteRun
from OpenCAD2D.Remote import CadRemoteRun
class CadRemoteRun(System.Object) ยท CadRemoteRun in the .NET reference
A run of a tool's command, as the tool sees it: the command the user typed in the app, which the app holds open (its command line says "<name> is working... (Esc to stop)") while the tool works. Everything the tool does on the connection that joined the run (CadApplication.JoinRun) is part of the command: its questions are asked on the command line, its commits are one undo step, and Esc ends it with every change taken back.
Properties and fields
Pause
Pause: ClassVar[str]
The answer of CadRemoteRun.RunCommand that leaves one prompt of the command to the user: one backslash, as AutoLISP's pause is.
Id
@property
def Id(self) -> int
Gets the number of the run, as the app gave it.
Methods
Ask
def Ask(
self,
kind: CadAskKind,
message: str,
basePoint: GeoPoint3 | None = ...,
keywords: System.Collections.Generic.IReadOnlyList[str] | None = ...,
defaultValue: str | None = ...,
) -> CadRemoteAnswer
Asks the user and waits for the answer. The prompt appears on the command line of the drawing the run works in, the user answers it as any command's: clicking on the canvas, typing a point or a number, a keyword by its capital letters, or Enter. The app stays free meanwhile, for the user and for every other client.
End
def End(self) -> None
Ends the run well: the changes it committed stay, as one undo step named after the command. The connection leaves the run.
Fail
def Fail(self, message: str) -> None
Ends the run that failed: the changes it committed are taken back, and the line is written on the command line. The connection leaves the run.
RunCommand
def RunCommand(self, name: str, answers: Sequence[object] | System.Array[object]) -> None
Runs a command to its end inside the run, as AutoLISP's command does: it asks its prompts on the command line, each answered in turn by the answers given, its changes join the one undo step of the run, and nothing is written about the run being resumed. CadRemoteRun.Pause leaves a prompt to the user, and the call waits for them; Esc then ends the run. A command that is still asking after the last answer is ended, and the call fails.
def RunCommand(self, name: str, *answers: object) -> None
Runs a command to its end inside the run, as AutoLISP's command does: it asks its prompts on the command line, each answered in turn by the answers given, its changes join the one undo step of the run, and nothing is written about the run being resumed. CadRemoteRun.Pause leaves a prompt to the user, and the call waits for them; Esc then ends the run. A command that is still asking after the last answer is ended, and the call fails.
Write
def Write(self, text: str) -> None
Writes a line on the command line of the drawing the run works in, as a command's own messages are written.