The Session and Viewport View objects store view settings for custom (both predefined and user-defined) views. The paradigm used to define a view is based on a camera analogy. Similar to taking a photograph with a camera, features such as camera position, view direction, orientation, depth of field, and projection are specified to transform three-dimensional views to the screen.
The Layer View objects store a transformation matrix used to position the contents of the Layer within a viewport.
session.viewports[name].layers[name].view session.viewports[name].view session.views[name]
This method creates a View object.
Note: All dimensions and coordinates are specified in the model coordinate system.
session.View
Required arguments
A String specifying the name of the view (also used as the repository key). Possible values are 'Front', 'Back', 'Top', 'Bottom', 'Left', `Right', 'Iso', 'User-1', 'User-2', 'User-3', and 'User-4'. The object member associated with this argument is a SymbolicConstant. Possible values of the name member are:FRONT, BACK, TOP, BOTTOM, LEFT, RIGHT, ISO, USER1, USER2, USER3, and USER4.
A Float specifying the viewing angle of the camera. Possible values are 0.0 fieldOfViewAngle 180.0.
A Float specifying the distance from the camera to the near clipping plane. Possible values are nearPlane 0.0.
A SymbolicConstant specifying how the distance from the camera to the far clipping plane is set. Possible values are AUTO_COMPUTE and SPECIFY.
A Float specifying the distance from the camera to the far clipping plane when farPlaneMode =SPECIFY. Possible values are farPlane nearPlane.
A Float specifying the width of the front clipping plane. Possible values are width 0.0.
A Float specifying the height of the front clipping plane. Possible values are height 0.0.
A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and PARALLEL.
A sequence of three Floats specifying the camera position.
A sequence of three Floats specifying the camera's up vector (the screen's positive Y-axis). The initial value is (0, 0, 0).
A sequence of three Floats specifying the center of the scene.
A Float specifying the amount to pan the model in the screen X-direction as a fraction of the viewport width. A positive value pans the model to the right. A negative value pans the model to the left.
TheviewOffsetX and viewOffsetY arguments allow you to pan the view without changing the position of the camera or the target (cameraPosition and cameraTarget arguments to the View method). The resulting change in the view allows you to pan a perspective display without producing an apparent rotation of the model.
A Float specifying the amount to pan the model in the screen Y-direction as a fraction of the viewport height. A positive value pans the model upward. A negative value pans the model downward.
A Boolean specifying whether the view is auto-fit when applied.
Optional argument
A Boolean specifying whether or not the camera is in movie mode. The default value is OFF.
Return value
A View object.
Exceptions
RangeError.
This method scales the displayable object (such as a part, the assembly, or an X–Y plot) to fit the viewport.
Required arguments
Optional argument
A Boolean specifying the viewport should refresh immediately after the command is processed. This is typically only used when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method restores the view in the viewport to the next view setting in the list. (There is a list of eight views stored for each viewport.) If there is no next view, no action is taken.
Required arguments
Optional argument
A Boolean specifying the viewport should refresh immediately after the command is processed. This is typically only used when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method pans the view in the viewport using absolute, not relative, mode.
Required arguments
Optional arguments
A Float specifying the amount to pan the model in the screen X-direction as a fraction of the viewport width. A positive value pans the model to the right. A negative value pans the model to the left. The default value is 0.0.
A Float specifying the amount to pan the model in the screen Y-direction as a fraction of the viewport height. A positive value pans the model upward. A negative value pans the model downward. The default value is 0.0.
A Boolean specifying the alternate mode of the pan view manipulation should be used. The default value is OFF. This argument is ignored for a Layer View.
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method restores the view in the viewport to the previous view setting in the list. (There is a list of eight views stored for each viewport.) If there is no previous view, no action is taken.
Required arguments
Optional argument
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method rotates the view in the viewport. If a center of rotation has been previously specified and asMovie is OFF then this method will honor that rotation center.
Required arguments
Optional arguments
A Float specifying the degrees to rotate about the X-axis. The default value is 0.0.
A Float specifying the degrees to rotate about the Y-axis. The default value is 0.0.
A Float specifying the degrees to rotate about theZ-axis. The default value is 0.0.
A SymbolicConstant specifying the rotation mode. Possible values are:
The default value is MODEL.
TOTAL : Set the view to (0, 0, 1), then rotate about the screen's axes (an absolute rotation).
SCREEN : Rotate incrementally about the screen's axes (a relative rotation).
MODEL : Rotate incrementally about the model's axes (a relative rotation).
A Boolean specifying the alternate mode of the rotate view manipulation should be used. The default value is OFF.
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method modifies the transformation used to position a Layer.
Required arguments
Optional arguments
A sequence of 16 Floats specifying the transformation matrix.
A View object from which the view settings are to be copied. If the layerTransform argument is also supplied to setLayerTransform, it will override the values in the View object specified by view.
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method modifies the appearance of three-dimensional models in the viewport. Choosing PERSPECTIVE makes a model appear more realistic by decreasing the apparent size of features that are farther away from the viewing point.
Required argument
A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and PARALLEL.
Optional argument
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
RangeError.
This method sets the center of rotation to the specified location.
Required argument
A sequence of a String and an Int specifying a part instance name and a node label or a sequence of 3 Floats specifying a point.
Optional arguments
Return value
Exceptions
TypeError: rotationCenter cannot be set using a part instance and node label unless the displayed object is an ODB
This method modifies the View object.
Required arguments
Optional arguments
The optional arguments to setValues are the same as the arguments to the View method, except for the name and autoFit arguments. In addition, setValues has the following optional arguments:
A View object from which the view settings are to be copied. If other arguments are also supplied to setValues, they will override the values in the View object specified by view.
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
RangeError.
This method sets the camera's position in the viewport.
Required argument
A sequence of three Floats specifying the viewing vector (from the camera to the origin of the model).
Optional arguments
A sequence of three Floats specifying the camera's up vector (the screen's positive Y-axis). The initial value is (0, 0, 0).
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
This method magnifies the view in the viewport.
Required argument
A Float specifying the amount to zoom. Possible values are 0.000001 zoomFactor 1000000. A zoomFactor less than one reduces the image. A zoomFactor greater than one enlarges the image.
Optional arguments
A SymbolicConstant specifying the way the zoom is executed. Possible values are:
The default value is ABSOLUTE.
ABSOLUTE : Execute fitView, then zoom.
RELATIVE : Zoom from the current camera settings.
A Boolean specifying the alternate mode of the zoom view manipulation should be used. The default value is OFF. This argument is ignored for a Layer View.
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
RangeError.
This method fills the viewport with the graphics located within the given rectangle.
Required arguments
A pair of Floats specifying theX- and Y-coordinates of one corner of the rectangle in fractions of the viewport width and height.
A pair of Floats specifying theX- and Y-coordinates of the other corner of the rectangle in fractions of the viewport width and height.
Optional argument
A Boolean specifying the viewport should refresh immediately after the command is processed. This argument is typically used only when writing a script and it is desirable to show intermediate results before the script completes. The default value is False.
Return value
Exceptions
The View object has members with the same names and descriptions as the arguments to the View method.
In addition, the View object has the following members:
A Float specifying the width in viewport millimeters of the bounding rectangle around the viewport contents. This value does not include annotations or symbols and it is not clipped to the size of the viewport window.
A Float specifying the height in viewport millimeters of the bounding rectangle around the viewport contents. This value does not include annotations or symbols and it is not clipped to the size of the viewport window.
A tuple of Floats specifying a transformation matrix used to position the contents of the Layer within a viewport.