Method SetViewportView
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
SetViewportView(string, GeoPoint2, double, string)
Sets the view a viewport shows of model space, one undo step: the point at the middle of its frame and the height it shows, so its scale is its height over that one. A viewport 150 high given a view 3 000 high shows model space at 1:20. The view it showed goes on the viewport's ZOOM Previous list, 20 at most.
public CadEditResult SetViewportView(string handle, GeoPoint2 viewCenter, double viewHeight, string name)
Parameters
handlestringThe handle of the viewport.
viewCenterGeoPoint2The point of model space at the middle of the frame, as the viewport keeps it (ViewCenter, about the view's target and turned by its twist; see ToView(DxfViewport, GeoPoint2)).
viewHeightdoubleThe height of model space shown, above nought.
namestringThe name of the undo step, as ZOOM or PAN.
Returns
- CadEditResult
What came of it: refused for no such viewport, a height not above nought, or a viewport whose display is locked.
Exceptions
- ArgumentNullException
Thrown when the name is null.
SetViewportView(string, GeoPoint2, double, string, bool)
Sets the view a viewport shows of model space, as SetViewportView(string, GeoPoint2, double, string); a real-time zoom or pan, the wheel's or the middle button's, made straight after another joins its undo step, as AutoCAD 2021 combines consecutive real-time zooms and pans where UNDO Control Combine is Yes (UNDOCTL has its 16; the machine measured has No, UNDOCTL 13, and the presenter starts as it does); with UNDO Control Combine No each is a step of its own. ZOOM and PAN typed stay a step each, as AutoCAD's console undoes ZOOM 2X, ZOOM 2X and -PAN one U each.
public CadEditResult SetViewportView(string handle, GeoPoint2 viewCenter, double viewHeight, string name, bool realTime)
Parameters
handlestringThe handle of the viewport.
viewCenterGeoPoint2The view's centre, as the viewport keeps it.
viewHeightdoubleThe height of model space shown, above nought.
namestringThe name of the undo step, as ZOOM or PAN; a step joined keeps the name of the first.
realTimeboolWhether the change is a real-time zoom or pan, which joins the step of the real-time one before it where no other step, a save or an undo came between.
Returns
- CadEditResult
What came of it, refused as the other overload refuses.
Exceptions
- ArgumentNullException
Thrown when the name is null.