Table of Contents

Method SendCommand

Namespace
OpenCAD2D.Remote
Assembly
OpenCAD2D.Remote.dll

SendCommand(string)

Types text on the drawing's command line, as the user would, and waits for the command to end. The drawing is shown first, since a command works on the drawing the user sees. Lines parted by a line feed are typed one after the other, and words in a line as if parted by Space, so "ZOOM E " zooms to the extents and "LINE 0,0 100,0" starts a line and gives two points. Waits up to 30 seconds.

public CadRemoteCommandResult SendCommand(string text)

Parameters

text string

The text.

Returns

CadRemoteCommandResult

Whether the command ended and what the command line wrote.

Exceptions

ArgumentNullException

Thrown when the text is null.

CadRemoteException

Thrown when the drawing is closed.

SendCommand(string, TimeSpan)

Types text on the drawing's command line as SendCommand(string) does, and waits up to a time for the command to end. A command that asks the user for a point stays running after the time: the result says so, and the command goes on in the app.

public CadRemoteCommandResult SendCommand(string text, TimeSpan timeout)

Parameters

text string

The text.

timeout TimeSpan

How long to wait for the command to end; zero does not wait.

Returns

CadRemoteCommandResult

Whether the command ended and what the command line wrote.

Exceptions

ArgumentNullException

Thrown when the text is null.

ArgumentOutOfRangeException

Thrown when the time is negative.

CadRemoteException

Thrown when the drawing is closed.