Table of Contents

ICadRemoteHost

from OpenCAD2D import ICadRemoteHost

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

What a CadRemoteServer needs of the app it serves: the drawings open, the one the user works in, and the ways to open, make, show and save one and to type on a drawing's command line. The app's window implements it over its view model; a test implements it over a few documents and no window. Every member is called on the thread of the ICadRemoteDispatcher the server was given, never from the pipe's own thread.

Properties and fields

ActiveDocument

.NET

@property
def ActiveDocument(self) -> CadDocument | None

Gets the drawing the user works in, or null when none is open.

Documents

.NET

@property
def Documents(self) -> System.Collections.Generic.IReadOnlyList[CadDocument]

Gets the drawings open now.

Title

.NET

@property
def Title(self) -> str

Gets the title of the app's window, as A-101.dwg - OpenCAD2D.

Methods

Activate

.NET

def Activate(self, document: CadDocument) -> None

Shows a drawing open in the app, as clicking its entry in the list does.

Close

.NET

def Close(self, document: CadDocument) -> None

Closes a drawing without asking and without saving, as the x of its row does once the question is answered Don't save: it leaves ICadRemoteHost.Documents, and the next one is shown, or the start screen where it was the last. The server has checked already that its changes are to be thrown away and that nothing runs in it, so the host asks the user nothing and shows no dialog.

New

.NET

def New(self, template: str) -> CadDocument

Starts a new drawing and shows it.

Open

.NET

def Open(self, path: str) -> CadDocument

Opens a drawing from a file and shows it, or shows it where it is open already.

Save

.NET

def Save(self, document: CadDocument) -> None

Saves a drawing to its file.

SaveAs

.NET

def SaveAs(self, document: CadDocument, path: str, version: str) -> None

Saves a drawing to a file, which it is known by afterwards.

SessionOf

.NET

def SessionOf(self, document: CadDocument) -> CadCommandSession

Gets the command session of a drawing: its command line, the commands running in it and what they wrote.

Type

.NET

def Type(self, document: CadDocument, line: str) -> None

Types a line on the command line of the drawing, as the user does: a command's name or the answer to its prompt, words parted by spaces going in one by one, an empty line being Enter.