Table of Contents

Method AddViewport

Namespace
OpenCAD2D.Remote
Assembly
OpenCAD2D.Remote.dll

AddViewport(string, IReadOnlyList<double>, string, IReadOnlyList<double>, IEnumerable<string>)

Asks the app to add a viewport to a layout that shows model space at a scale, as MVIEW with two corners does, one undo step.

public string AddViewport(string layout, IReadOnlyList<double> frame, string scale, IReadOnlyList<double> center, IEnumerable<string> frozenLayers)

Parameters

layout string

The layout, not Model.

frame IReadOnlyList<double>

The rectangle on the sheet, [x1, y1, x2, y2] in millimetres.

scale string

As 1:50 or 0.02 (paper millimetres to the unit).

center IReadOnlyList<double>

The point of model space at the middle of the frame, [x, y]; null for the middle of what model space draws.

frozenLayers IEnumerable<string>

The layers to freeze in this viewport only, or null.

Returns

string

The handle of the viewport.

Exceptions

ArgumentNullException

Thrown when the layout, the frame or the scale is null.

CadRemoteException

Thrown when the drawing is closed, a command is running in it, or an argument is refused (see CadLayouts.AddViewport).