Acad.Editor.CurrentViewport Function
File
Autodesk.AutoCAD.js
Syntax
JavaScript
function Acad.Editor.CurrentViewport();
Group
Description
Represents the current viewport and stores view properties like camera position, target, fieldheight, fieldWidth, upVector, and projection.
Properties
| Name | Type | Description | Condition |
|---|---|---|---|
| fieldHeight | float | Gets the camera field height. Ensure that FieldHeight is not used when the view is in the interactive state. |
Read-only |
| fieldWidth | float | Gets the camera field width. Ensure that FieldWidth is not used when the view is in the interactive state. |
Read-only |
| position | Acad.Point3d | Gets the camera position. Ensure not to use Position when the view is in the interactive state. |
Read-only |
| projection | Acad.Enum_Projection | Gets the projection. Ensure that Projection is not used when the view is in the interactive state. |
Read-only |
| target | Acad.Point3d | Gets the camera target. Ensure not to use Target when the view is in the interactive state. |
Read-only |
| upVector | Acad.Vector3d | Gets the camera up vector. Ensure not to use UpVector when the view is in the interactive state. |
Read-only |
Note: An
Error object is thrown if you to set the value of a Read-only property.