Utility and View¶
Utility commands are used to do the following:
Create SymbolicConstant and Boolean objects.
Change the name of a key to a Repository object.
Control the use of deprecated commands.
Request input from the user.
Display status information.
Execute Python commands or functions.
Register a callback that will be invoked when certain Abaqus Scripting Interface commands are about to be executed.
Register a callback that will be invoked when certain Abaqus Scripting Interface objects are about to be deleted.
Upgrade Abaqus kernel or GUI scripts from one release of Abaqus to a later release.
View commands are used to transform three-dimensional views stored in Session and Viewport objects to the screen. (See Session object and Viewport object.)
Other Classes¶
- class AbaqusBoolean(value)[source]¶
Bases:
int
The AbaqusBoolean object is used in a similar way to the SymbolicConstant object. If you pass an AbaqusBoolean object to the Python repr() function, the function returns the text without quotes. In effect, the text is the variable that, by convention, refers to the AbaqusBoolean object. An AbaqusBoolean object has a value of 0 or 1, and an AbaqusBoolean object can be tested in an if statement. You can use an AbaqusBoolean object as an argument to a method in place of 1 or 0. Conversely, you can pass a 0 or a 1 to an Abaqus Scripting Interface method that expects a Boolean argument, and the 0 or 1 will be coerced to the appropriate AbaqusBoolean value. There are only two possible values for an AbaqusBoolean object: 1 and 0. You can import both values from the symbolicConstants module or from the abaqus module. Abaqus Scripting Interface commands that expect an AbaqusBoolean object will also accept a Python bool (True, False), or a Python int (1, 0).
Note
This object can be accessed by:
from symbolicConstants import * from abaqusConstants import *
Note
Member Details:
- class BackwardCompatibility[source]¶
Bases:
object
The BackwardCompatibility object enables the user to control access to deprecated commands in the Abaqus Scripting Interface and to collect data on which deprecated commands have been used. This enables the user to check that no deprecated methods, members, or arguments have been used. Data are recorded on any deprecated members, methods, or arguments that are used. The BackwardCompatibility object has no constructor. The abaqus module and the odbAccess module each have a member named backwardCompatibility. By default, the value of the includeDeprecated member is ON, and Abaqus will execute a script containing deprecated commands with no indication that you should update the script. You can do either of the following to change the value of the includeDeprecated member and to determine which commands have been deprecated:
From the command line interface in Abaqus/CAE or from an Abaqus Scripting Interface script that is run from within Abaqus/CAE, use the following command:
backwardCompatibility.setValues(includeDeprecated=OFF)
From an Abaqus Scripting Interface script that is run using abaqus python at the system prompt, use the following two commands:
from odbAccess import * backwardCompatibility.setValues(includeDeprecated=OFF)
In addition, the BackwardCompatibility object provides tools to assist you in determining the deprecated commands that have been used. For example, to determine the deprecated commands used in the script createLug.py, use the following commands:
backwardCompatibility.resetDeprecatedMethodsUsed() backwardCompatibility.resetDeprecatedMembersUsed() backwardCompatibility.resetDeprecatedArgsUsed() execfile('createLug.py') print backwardCompatibility.getDeprecatedMethodsUsed() print backwardCompatibility.getDeprecatedMembersUsed() print backwardCompatibility.getDeprecatedArgsUsed()
Note
This object can be accessed by:
backwardCompatibility
Note
Member Details:
- getDeprecatedArgsUsed()[source]¶
This method returns a list of deprecated arguments used since the last call to resetDeprecatedArgsUsed.
- getDeprecatedMethodsUsed()[source]¶
This method returns a list of deprecated methods used since the last call to resetDeprecatedMethodsUsed.
-
includeDeprecated : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
1
[source]¶ A Boolean specifying whether deprecated members, methods, and arguments can be seen and used. Possible values are ON and OFF. The default value is ON.
-
reportDeprecated : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
True
[source]¶ A Boolean specifying whether a warning is displayed after running a script that contains deprecated commands. The default value is True.
- setValues(
- includeDeprecated=
1
, - reportDeprecated=
True
, - showKeysInReport=
False
, This method modifies the BackwardCompatibility object.
- Parameters:¶
- includeDeprecated=
1
¶ A Boolean specifying whether deprecated members, methods, and arguments can be seen and used. The default value is ON.
- reportDeprecated=
True
¶ A Boolean specifying whether a warning is displayed after running a script that contains deprecated commands. The default value is True.
- showKeysInReport=
False
¶ A Boolean specifying whether the keys and indices are included in the report that is displayed when reportDeprecated is True. The default value is False.
- includeDeprecated=
-
showKeysInReport : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
False
[source]¶ A Boolean specifying whether the keys and indices are included in the report that is displayed when reportDeprecated is True. The default value is False.
-
addImportCallback(moduleName, callback, userData=
''
)[source]¶ This function defines a function to be called when a specified Abaqus/CAE module is imported. You cannot specify a custom module. For more information, see An example of a callback function.
Note
This function can be accessed by:
addImportCallback
Note
- Parameters:¶
- moduleName¶
A String specifying the name of a specified Abaqus/CAE module.
- callback¶
A Python function to be called. The interface definition of the callback function is def functionName(moduleName, userData). moduleName is a String. userData is the object passed as the userData argument to the addImportCallback method.
- userData=
''
¶ Any Python object or None. This object is passed to the callback function.
- removeImportCallback(callback, userData)[source]¶
This function removes a callback added in addImportCallback.
Note
This function can be accessed by:
removeImportCallback
- journalMethodCall(objectPath, methodName, args, kargs)[source]¶
This function may be used by a user-defined command to record itself in the Abaqus journal file. For example:
def setValues(self, **kargs): for arg,value in kargs.items(): setattr(arg, value) from abaqus import journalMethodCall objPath = '%s[%r]' % (self.reposPath, self.name) journalMethodCall(objPath, 'setValues', (), kargs)
Note
Your command should not call journalMethodCall if the command changes the mdb using built-in Abaqus Scripting Interface commands, because built-in commands are journaled by default. A command that changes the mdb customData is one example of a command that should call journalMethodCall.
Note
This function can be accessed by:
journalMethodCall
- Parameters:¶
-
deleteObjectCallback(callback, path, userData=
None
, includeChildren=False
)[source]¶ This method adds a callback function that will be invoked when the specified Abaqus Scripting Interface objects are about to be deleted. The callback is invoked only when the object is deleted using the Python statement del object. The callback is not invoked when the object is deleted using an Abaqus Scripting Interface command such as mdb.models[name].parts[name].deleteFeature().
Note
This function can be accessed by:
deleteObjectCallback.addCallback
Note
- Parameters:¶
- callback¶
A Python function to be called when an object matching the specified path is about to be deleted. The interface definition of the callback function is def functionName(objectPath, userData) where objectPath is the path to the object about to be deleted. userData is the object passed as the userData argument to the addCallback method.
- path¶
A String specifying the path to an object or the SymbolicConstant ANY. You can include wildcards in the path to specify a pattern to be matched. Examples of valid paths are path=’mdb.models[*]’ path=”mdb.models[‘Axle*’].parts[*]”, and path=’mdb.models[*].materials[*]’
- userData=
None
¶ Any type of data. This data will be passed to the callback function. The default value is None.
- includeChildren=
False
¶ A Boolean specifying that the callback should be called if an object owned by the object specified by the path argument is about to be deleted. The default value is False.
-
addCallback(caller, methodName, callback, userData=
None
, callAfter=0
)[source]¶ This method adds a callback function that will be invoked when certain Abaqus/CAE commands are about to be executed.
Note
This function can be accessed by:
methodCallback.addCallback
Note
- Parameters:¶
- caller¶
An object or type object specifying which object will trigger the callback function to be invoked or the Symbolic Constant ALL_TYPES.
- methodName¶
A String specifying the name of the method on the caller that will trigger the callback function to be invoked or the Symbolic Constant ALL_METHODS.
- callback¶
A Python function to be called when a command matching the specified caller and method name is about to be executed. The interface definition of the callback function is def functionName(callingMethod, args, keywordArgs, userData) where callingMethod is the method that called this function. args is the sequence of non-keyword arguments that was passed to the calling method. keywordArgs is the dictionary of keyword arguments that was passed to the calling method. userData is the object passed as the userData argument to the addCallback method.
- userData=
None
¶ Any type of data. This data will be passed to the callback function. The default value is None.
- callAfter=
0
¶ A Boolean specifying that the callback should be called after the method has executed (instead of before the method is called). The default value is False, which indicates that the callback should be called before the method has executed. If callAfter = True, you can also access the return value of the command from within the callback by including the following statement returnValue = getMethodReturnValue() The getMethodReturnValue function is in the global namespace of the callback function.
-
removeCallback(caller, methodName, callback, userData=
None
)[source]¶ This method removes a callback added by the addCallback method. To successfully remove a callback, all arguments must exactly match those used when the callback was added.
Note
This function can be accessed by:
methodCallback.removeCallback
Note
- Parameters:¶
- caller¶
An object or type object specifying which object will trigger the callback function to be invoked or the Symbolic Constant ALL_TYPES.
- methodName¶
A String specifying the name of the method on the caller that will trigger the callback function to be invoked or the Symbolic Constant ALL_METHODS.
- callback¶
A Python function to be called when a command matching the specified caller and method name is about to be executed. The interface definition of the callback function is def functionName(callingMethod, args, keywordArgs, userData) where callingMethod is the method that called this function. args is the sequence of nonkeyword arguments that was passed to the calling method. keywordArgs is the dictionary of keyword arguments that was passed to the calling method. userData is the object passed as the userData argument to the removeCallback method.
- userData=
None
¶ Any type of data. This data will be passed to the callback function. The default value is None.
- class Repository[source]¶
Bases:
Dict
Repositories are containers that store a particular type of object; for example, the steps repository contains all the steps defined in the model. An Abaqus Scripting Interface Repository maps a key to a value. The key is usually a String, and the value is any Python object, usually an Abaqus object. A repository is similar to a Python dictionary; however, only a constructor can add an object to a repository. In addition, all of the objects in a repository are of the same base type. For more information, see Repositories. A Repository has no constructor. Abaqus creates empty repositories when you import a module. For example, Abaqus creates an empty parts repository when you import the part module. The following methods of the Repository object are standard Python dictionary methods and are not described here:
The Repository object is derived from the dict object. - has_key - items - keys - values - [changeKey(…)](https://help.3ds.com/2022/english/DSSIMULIA_Established/SIMACAEKERRefMap/simaker-c-utlrepositorypyc.htm?ContextScope=all#simaker-utlrepositorychangekeypyc)
Note
Member Details:
- milestone(message: str)[source]¶
- milestone(message: str, percent: int)
- milestone(message: str, object: str)
- milestone(*args, **kwargs)
- class SymbolicConstant(text)[source]¶
Bases:
str
The SymbolicConstant object represents a string in a way that can be stored in a replay file and used as an argument to Abaqus Scripting Interface methods and functions. By convention the string representation of the SymbolicConstant object is the same as its variable name. If you pass a SymbolicConstant object to the Python repr() function, the function returns the text without quotes. In effect, the text is the variable that, by convention, refers to the SymbolicConstant object. Two SymbolicConstant objects with the same text are the same Python object, although you can assign them to different variables. All of the SymbolicConstant objects that are required in Abaqus Scripting Interface methods are defined in the abaqusConstants module. Some SymbolicConstant objects and the SymbolicConstant constructor are defined in the abaqus module. The SymbolicConstant constructor is also defined in the symbolicConstants module.
Note
This object can be accessed by:
from symbolicConstants import * from abaqusConstants import *
Note
Member Details:
- class abaqusConstants(text)[source]¶
Bases:
SymbolicConstant
,Enum
Member Details:
- upgradeScript(
- fileNames,
- searchSubdirectories=
True
, - backup=
True
, - preview=
True
, - diffExecutable=
''
, - logFileName=
'asiUpgrade'
, - fromVersion=
EARLIEST
, - toVersion=
LATEST
, - scriptType=
BOTH
, This function can be used to upgrade a directory, a file, or a list of both directories and files. You can preview the changes before you choose to upgrade the file. A user interface to this function is available via the Plug-ins menu. For more information, see Upgrading a script. You can also use a simpler interface from the command line to upgrade scripts. For more information, see the summary of changed commands at the end of this guide.
Note
This function can be accessed by:
upgradeScript.upgradeScript
Note
- Parameters:¶
- fileNames¶
A String or sequence of Strings specifying the files or directories to upgrade. If a directory path is found, it will be searched for files with the suffix .py or .guiLog. If searchSubdirectories is True, any directories found within a directory will also be searched.
- searchSubdirectories=
True
¶ A Boolean specifying whether to search any subdirectories (if the file name is a directory). If searchSubdirectories is True, the command will search the subdirectories of any directory in fileNames. If searchSubdirectories is False, the command will search the directory but not the subdirectories. The default value is True.
- backup=
True
¶ A Boolean specifying whether to make backups of the files. The default value is True. This argument is ignored if preview is set.
- preview=
True
¶ A Boolean specifying whether to preview the changes to the file instead of changing the file. If preview is True, display a preview of the file changes. The default value is True.By default, the preview is displayed in a web browser. The diffExecutable argument allows you to specify a different application in which to preview the changes.
- diffExecutable=
''
¶ A String specifying the application used to display the differences between the script and the upgraded script. The default value is an empty string, and the differences are displayed by a web browser. Examples of values for diffExecutable are winmerge and diff. This argument is ignored if preview is False.
- logFileName=
'asiUpgrade'
¶ A String specifying the name of the log file where any warnings and changes found during the upgrade are written. The default value is asiUpgrade.log.
- fromVersion=
EARLIEST
¶ A String specifying the Abaqus release from which to upgrade. The default value is EARLIEST.
- toVersion=
LATEST
¶ A String specifying the Abaqus release to which to upgrade. The default value is LATEST.
- scriptType=
BOTH
¶ A SymbolicConstant specifying the type of scripting commands to be upgraded. Possible values are KERNEL, GUI, or BOTH. If scriptType is KERNEL only Abaqus Scripting Interface commands will be upgraded; if scriptType is GUI only Abaqus GUI Toolkit commands will be upgraded. The default value is BOTH.
- Returns:¶
The number of changes made or, if preview was used, the number of changes that would have been made.
- Return type:¶
-
getInput(prompt: str, default: str =
''
)[source]¶ -
getInput(fields: tuple, label: str =
''
) - getInput(*args, **kwargs)
- getWarningReply(message, buttons)[source]¶
This method is used to obtain a reply from a user from a warning dialog box. The method displays a modal warning dialog box with a message and standard buttons. The user clicks the one of the standard buttons, the getWarningReply returns the corresponding button value and closes the dialog box. You can use a separator in the message argument to provide a multi-line message in the warning dialog box; for example:
from abaqus import * getWarningReply('Out of disk space!\nOkay to continue', (YES, NO))
Note
You cannot use a script that contains getWarningReply if you are running the script from the command line and passing the script name to the command line options -start, -script, -replay, or -noGUI.
Note
This function can be accessed by:
getWarningReply
Note
- class View(
- name,
- nearPlane,
- farPlane,
- width,
- height,
- projection,
- cameraPosition,
- cameraUpVector,
- cameraTarget,
- viewOffsetX,
- viewOffsetY,
- autoFit,
- movieMode=
0
, Bases:
object
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.
Note
This object can be accessed by:
session.viewports[name].layers[name].view session.viewports[name].view session.views[name]
Note
Check View on help.3ds.com/2018.
Member Details:
- autoFit : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`][source]¶
A Boolean specifying whether the view is auto-fit when applied.
- cameraPosition : --is-rst--:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`, :py:class:`float`][source]¶
A sequence of three Floats specifying the camera position.
- cameraTarget : --is-rst--:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`, :py:class:`float`][source]¶
A sequence of three Floats specifying the center of the scene.
- cameraUpVector : --is-rst--:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`, :py:class:`float`][source]¶
A sequence of three Floats specifying the camera’s up vector (the screen’s positive Y axis). The initial value is (0, 0, 0).
-
displayedObjectScreenHeight : --is-rst--:py:class:`float` | :py:obj:`None` =
None
[source]¶ 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.
-
displayedObjectScreenWidth : --is-rst--:py:class:`float` | :py:obj:`None` =
None
[source]¶ 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.
- farPlane : --is-rst--:py:class:`float`[source]¶
A Float specifying the distance from the camera to the far clipping plane when farPlaneMode =SPECIFY. Possible values are farPlane > nearPlane.
-
fitView(drawImmediately=
False
)[source]¶ This method scales the displayable object (such as a part, the assembly, or an X - Y plot) to fit the viewport.
Note
- height : --is-rst--:py:class:`float`[source]¶
A Float specifying the height of the front clipping plane. Possible values are height > 0.0.
-
layerTransform : --is-rst--:py:class:`tuple`\ \[:py:class:`float`, :py:data:`...<Ellipsis>`] =
()
[source]¶ A tuple of Floats specifying a transformation matrix used to position the contents of the Layer within a viewport.
-
movieMode : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[source]¶ A Boolean specifying whether or not the camera is in movie mode. The default value is OFF.
- name : --is-rst--:py:class:`str`[source]¶
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.
- nearPlane : --is-rst--:py:class:`float`[source]¶
A Float specifying the distance from the camera to the near clipping plane. Possible values are nearPlane > 0.0.
-
next(drawImmediately=
False
)[source]¶ 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. Note:This method is not available for a Layer View.
Note
-
pan(xFraction=
0
, yFraction=0
, asMovie=0
, drawImmediately=False
)[source]¶ This method pans the view in the viewport using absolute, not relative, mode.
Note
- Parameters:¶
- xFraction=
0
¶ 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.
- yFraction=
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.
- asMovie=
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.
- drawImmediately=
False
¶ 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.
- xFraction=
-
previous(drawImmediately=
False
)[source]¶ 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. Note:This method is not available for a Layer View.
Note
- projection : --is-rst--:py:data:`~typing.Literal`\ \[``PERSPECTIVE``, ``PARALLEL``][source]¶
A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and PARALLEL.
-
rotate(xAngle=
0
, yAngle=0
, zAngle=0
, mode=MODEL
, asMovie=0
, drawImmediately=False
)[source]¶ 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.
Note
- Parameters:¶
- xAngle=
0
¶ A Float specifying the degrees to rotate about the X axis. The default value is 0.0.
- yAngle=
0
¶ A Float specifying the degrees to rotate about the Y axis. The default value is 0.0.
- zAngle=
0
¶ A Float specifying the degrees to rotate about the*Z*-axis. The default value is 0.0.
- mode=
MODEL
¶ A SymbolicConstant specifying the rotation mode. Possible values are:
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).
The default value is MODEL.
- asMovie=
0
¶ A Boolean specifying the alternate mode of the rotate view manipulation should be used. The default value is OFF.
- drawImmediately=
False
¶ 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.
- xAngle=
-
setLayerTransform(layerTransform=
()
, options=None
, drawImmediately=False
)[source]¶ This method modifies the transformation used to position a Layer. Note:This method is not available for Session and Viewport Views.
Note
- Parameters:¶
- layerTransform=
()
¶ A sequence of 16 Floats specifying the transformation matrix.
- options=
None
¶ 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.
- drawImmediately=
False
¶ 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.
- layerTransform=
-
setProjection(projection, drawImmediately=
False
)[source]¶ 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. Note:This method is not available for a Layer View.
Note
- Parameters:¶
- projection¶
A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and PARALLEL.
- drawImmediately=
False
¶ 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.
- Raises:¶
RangeError –
- setRotationCenter(rotationCenter)[source]¶
This method sets the center of rotation to the specified location.
Note
- setValues(
- options=
Ellipsis
, - drawImmediately=
False
, - fieldOfViewAngle=
0
, - farPlaneMode=
Ellipsis
, - nearPlane=
0
, - farPlane=
0
, - width=
0
, - height=
0
, - projection=
Ellipsis
, - cameraPosition=
Ellipsis
, - cameraUpVector=
Ellipsis
, - cameraTarget=
Ellipsis
, - viewOffsetX=
0
, - viewOffsetY=
0
, - movieMode=
0
, This method modifies the View object.
Note
This method is not available for a Layer View.
The optional arguments to
setValues
are the same as the arguments to the View method, except for thename
andautoFit
arguments. In addition,setValues
has the following optional arguments:Note
- Parameters:¶
- options=
Ellipsis
¶ 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 byview
.- drawImmediately=
False
¶ 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.
- fieldOfViewAngle=
0
¶ A Float specifying the viewing angle of the camera. Possible values are 0.0 < filedOfViewAngle < 180.0.
- farPlaneMode=
Ellipsis
¶ A SymbolicConstant specifying how the distance from the camera to the far clipping plane is set. Possible values are AUTOCOMPUTE and SPECIFY.
- options=
- Return type:¶
None.
- Raises:¶
RangeError –
-
setViewpoint(viewVector, cameraUpVector=
()
, drawImmediately=False
)[source]¶ This method sets the camera’s position in the viewport. Note:This method is not available for a Layer View.
Note
- Parameters:¶
- viewVector¶
A sequence of three Floats specifying the viewing vector (from the camera to the origin of the model).
- cameraUpVector=
()
¶ A sequence of three Floats specifying the camera’s up vector (the screen’s positive Y axis). The initial value is (0, 0, 0).
- drawImmediately=
False
¶ 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.
- viewOffsetX : --is-rst--:py:class:`float`[source]¶
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 viewOffsetX 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.
- viewOffsetY : --is-rst--:py:class:`float`[source]¶
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.
- width : --is-rst--:py:class:`float`[source]¶
A Float specifying the width of the front clipping plane. Possible values are width > 0.0.
-
zoom(zoomFactor, mode=
ABSOLUTE
, asMovie=0
, drawImmediately=False
)[source]¶ This method magnifies the view in the viewport.
Note
- Parameters:¶
- zoomFactor¶
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.
- mode=
ABSOLUTE
¶ A SymbolicConstant specifying the way the zoom is executed. Possible values are:
ABSOLUTE : Execute fitView, then zoom.
RELATIVE : Zoom from the current camera settings.
The default value is ABSOLUTE.
- asMovie=
0
¶ 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.
- drawImmediately=
False
¶ 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.
- Raises:¶
RangeError –
-
zoomRectangle(point1, point2, drawImmediately=
False
)[source]¶ This method fills the viewport with the graphics located within the given rectangle.
Note
- Parameters:¶
- point1¶
A pair of Floats specifying the*X*- and Y coordinates of one corner of the rectangle in fractions of the viewport width and height.
- point2¶
A pair of Floats specifying the*X*- and Y coordinates of the other corner of the rectangle in fractions of the viewport width and height.
- drawImmediately=
False
¶ 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.