Method AddViewport
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
layoutstringThe layout, not Model.
frameIReadOnlyList<double>The rectangle on the sheet,
[x1, y1, x2, y2]in millimetres.scalestringAs
1:50or0.02(paper millimetres to the unit).centerIReadOnlyList<double>The point of model space at the middle of the frame,
[x, y]; null for the middle of what model space draws.frozenLayersIEnumerable<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).