Canvas¶
Canvas commands are used to create, position, and modify canvas objects. The Canvas commands need only the abaqus module to be imported; no additional modules need to be imported.
Create layers in a viewport¶
Viewport¶
- class Viewport(
- name,
- origin=
(0.0, 0.0)
, - width=
120.0
, - height=
80.0
, - border=
1
, - titleBar=
1
, - titleStyle=
SYSTEM
, - customTitleString=
''
, Bases:
AnnotationViewport
Public Data Attributes:
Inherited from
ViewportBase
A pair of Floats specifying the X and Y coordinates in millimeters in the canvas coordinate system of the lower left corner of the viewport.
A Float specifying the width in millimeters of the viewport.
A Float specifying the height in millimeters of the viewport.
A Boolean specifying whether the viewport border is visible in a printed image.
A Boolean specifying whether the viewport title should be displayed in a printed image.
A SymbolicConstant specifying which title to use for the viewport title.
A String specifying the viewport title when titleStyle =CUSTOM.
A Float specifying a factor to be used in offsetting layers in the screen Z direction.
A Float specifying the width in millimeters of the current viewport, regardless of the value of windowState.
A Float specifying the height in millimeters of the current viewport, regardless of the value of windowState, and including the title bar.
A Boolean specifying whether the viewport is linked for synchronization.
A SymbolicConstant specifying the currently active color mappings.
A SymbolicConstant specifying the last applied color mapping.
A Float specifying the translucency that will be applied to objects colored using initialColor and it needs to be set along with initialColor.
A Boolean specifying whether an animation is connected to the viewport.
A repository of AttributeColorMap objects specifying the objects cannot be constructed but the following attribute maps are supported:
A String specifying the color that will be applied to all objects in the viewport at the start of color coding.
A String specifying which layer is affected by options settings when displayMode =OVERLAY.
A Displayable object specifying the object to be displayed.
A repository of Layer objects specifying the key to the repository is a String with the name of the layer.
An OdbDisplay object specifying the display options for the Odb object.
A PartDisplayOptions object specifying the display options for the Part object.
An AssemblyDisplayOptions object specifying the display options for the Assembly object.
A ViewportAnnotationOptions object.
A DetailPlotOptions object.
An AnnotationsToPlotArray object.
A tuple of Strings specifying the names of layers that will be displayed in the viewport when displayMode = OVERLAY.
A pair of Floats specifying the X and Y coordinates in millimeters in the canvas coordinate system of the lower left corner of the current viewport, regardless of the value of windowState.
A pair of Floats specifying the X and Y coordinates in millimeters of the lower left corner of the current viewport from a coordinate system having its origin in the lower left corner of the drawing area.
A LightOptions object.
An ImageOptions object.
A MovieOptions object.
A tuple of Strings specifying keys to the session.drawings repository.
A String specifying the repository key.
A SymbolicConstant specifying the display mode of the viewport.
A SymbolicConstant specifying which layer or layers will be controlled by the view manipulation tools when displayMode = OVERLAY.
A SymbolicConstant specifying the current state of a viewport.
A View object specifying the object that controls viewing of the viewport content.
Public Methods:
Layer
(name[, copyViewName])This method creates a Layer object in the Layer repository.
Inherited from
AnnotationViewport
plotAnnotation
(annotation[, index])This method plots an Annotation object in aViewport.
Inherited from
ViewportBase
__init__
(name[, origin, width, height, ...])This method creates a Viewport object with the specified origin and dimensions.
This method moves the Viewport object to the front.
This method disables applying multiple color mappings that was enabled using enableMultipleColors.
This method disables Viewport refresh.
This method disables Viewport updates and internal computations triggered because of color coding.
This method enables multiple color mappings to be applied at the same time.
This method enables Viewport refresh disabled using disableRefresh.
This method enables Viewport color code updates disabled using disableColorCodeUpdates.
getActiveElementLabels
([useCut, printResults])This method returns the element labels currently active in the viewport based on the current display group.
getActiveNodeLabels
([useCut, printResults])This method returns the node labels currently active in the viewport based on the current display group.
This method returns a dictionary containing the minimum, maximum and their location for the current primary variable.
This method makes theViewport object the current viewport.
maximize
()This method maximizes the Viewport object to fill the drawing area.
minimize
()This method minimizes the Viewport object to appear as an abbreviated title bar.
offset
([deltaX, deltaY])This method modifies the current X Y location of the viewport by the specified distance.
restore
()This method restores a maximized or minimized Viewport object to its previous size and location.
This method moves the Viewport object to the back.
setColor
()This method causes the Viewport to refresh immediately.
setValues
([displayedObject, displayMode, ...])This method modifies the Viewport object.
addDrawings
([names])This method identifies the names of Drawing objects to be rendered in the Viewport.
removeDrawings
([names])This method identifies the names of Drawing objects to no longer be rendered in the Viewport.
timeDisplay
([numFrames, numSeconds, ...])This method refreshes the Viewport display numFrames times and then checks to see if numSeconds seconds have elapsed.
Inherited from
_OptionsBase
get_user_attributes
()Returns a list of the user attributes of the class.
setValues
(**kwargs)This method modifies the _OptionsBase object.
Member Details:
-
Layer(name, copyViewName=
''
)[source]¶ This method creates a Layer object in the Layer repository.
Note
This function can be accessed by:
session.viewports[name].Layer
Note
Check Layer on help.3ds.com/2017.
-
Layer(name, copyViewName=
Other Classes¶
- class AttributeColorMap[source]¶
Bases:
_OptionsBase
The AttributeColorMap object is used to store values and attributes associated with AttributeColorMap type objects. AttributeColorMap objects can be modified using the methods described below. The methods accessed via the Viewport object cause the AttributeColorMap object to be updated in the session.viewports[name].colorMappings repository.
Note
This object can be accessed by:
session.viewports[name].colorMappings[name]
Note
Member Details:
-
attributeColors : --is-rst--:py:class:`dict` | :py:obj:`None` =
None
[source]¶ A Dictionary object specifying the color settings of each attribute as described in the
abaqus.Canvas.AttributeColorMap.updateOverrides()
method.
-
defaultOverrides : --is-rst--:py:class:`dict` | :py:obj:`None` =
None
[source]¶ A Dictionary object specifying a custom color mapping similar to overrides. For example: defaultOverrides = {‘Copper’:(1,’’#00FF00’, ‘#00CCFF’, ‘#00FF00’)} The color mapping can contain keys that have not been created. When the key is created, it gets the appropriate values from this mapping.
- mapType : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant`[source]¶
A SymbolicConstant specifying the type of AttributeColorMap . Possible values are MATERIAL_MAP, SECTION_MAP, PART_MAP, ELSET_MAP, AVERAGING_REGION_MAP, and ELTYPE_MAP.
-
setValues(overrides=
None
, defaultOverrides=None
)[source]¶ This method modifies the AttributeColorMap object.
Note
- Parameters:¶
- overrides=
None
¶ A Dictionary object specifying a color mapping. Each key is of String type and specifies an attribute in the map; the corresponding values specify the color definition to apply to that attribute in the form (0|1, wire color, edge color, face color). The 0|1 defines the active status for the attribute. For example: overrides = {‘Part-1’:(1,’#00FF00’, ‘#00CCFF’, ‘#00FF00’)}
- defaultOverrides=
None
¶ A Dictionary object specifying a custom color mapping similar to overrides. For example: defaultOverrides = {‘Copper’:(1,’’#00FF00’, ‘#00CCFF’, ‘#00FF00’)}. The color mapping can contain keys that have not been created. When the key is created, it gets the appropriate values from this mapping.
- overrides=
-
updateOverrides(overrides=
None
, defaultOverrides=None
)[source]¶ This method specifies additional overrides to be added to the current object definition.
- Parameters:¶
- overrides=
None
¶ A Dictionary object specifying a color mapping. Each key is of String type and specifies an attribute in the map; the corresponding values specify the color definition to apply to that attribute in the form (0|1, wire color, edge color, face color). The 0|1 defines the active status for the attribute. For example: overrides = {‘Part-1’:(1,’#00FF00’, ‘#00CCFF’, ‘#00FF00’)}
- defaultOverrides=
None
¶ A Dictionary object specifying a custom color mapping similar to overrides. For example: defaultOverrides={‘Copper’:(1,’’#00FF00’, ‘#00CCFF’, ‘#00FF00’)} The color mapping can contain keys that have not been created. When the key is created, it gets the appropriate values from this mapping.
- overrides=
-
attributeColors : --is-rst--:py:class:`dict` | :py:obj:`None` =
- class CanvasSession[source]¶
Bases:
SessionBase
Member Details:
- Viewport(
- name,
- origin=
(0.0, 0.0)
, - width=
120.0
, - height=
80.0
, - border=
1
, - titleBar=
1
, - titleStyle=
SYSTEM
, - customTitleString=
''
, This method creates a Viewport object with the specified origin and dimensions.
Note
This function can be accessed by:
session.Viewport
Note
- Parameters:¶
- name¶
A String specifying the repository key.
- origin=
(0.0, 0.0)
¶ A pair of Floats specifying the X and Y coordinates in millimeters in the canvas coordinate system of the lower left corner of the viewport. The default origin is (0, 0).
- width=
120.0
¶ A Float specifying the width in millimeters of the viewport. Possible values are 30 ≤ width ≤ (maxWidth). The default value is 120.0. Note: The maximum value of width (maxWidth) is the width of the screen in millimeters.
- height=
80.0
¶ A Float specifying the height in millimeters of the viewport. This height includes the title bar. Possible values are 30 ≤ height ≤ (maxHeight). The default value is 80.0. Note: The maximum value of height (maxHeight) is the height of the screen in millimeters.
- border=
1
¶ A Boolean specifying whether the viewport border is visible in a printed image. The default value is ON.
- titleBar=
1
¶ A Boolean specifying whether the viewport title should be displayed in a printed image. The default value is ON.If border = OFF, the title will not be visible, even if titleBar =ON.
- titleStyle=
SYSTEM
¶ A SymbolicConstant specifying which title to use for the viewport title. Possible values are CUSTOM and SYSTEM. The default value is SYSTEM.If titleStyle = CUSTOM, customTitleString will be used. If titleStyle = SYSTEM, a system-generated string will be used.
- customTitleString=
''
¶ A String specifying the viewport title when titleStyle =CUSTOM. The default value is an empty string.
- Returns:¶
A Viewport object.
- Return type:¶
- Raises:¶
SystemError – the current viewport may not be deleted, If the user attempts to delete the only viewport.
RangeError – If width is out of range.
RangeError – If height is out of range.
- class DrawingArea[source]¶
Bases:
object
The DrawingArea object specifies the location and size of the drawing area used for placement of viewports.
Note
This object can be accessed by:
session.drawingArea
Note
Member Details:
- highlight(object)[source]¶
This method highlights an object in the current viewport.
Note
This function can be accessed by:
highlight
Note
- Parameters:¶
- object¶
An object specifying the object in the current viewport to be highlighted. You can specify only a single object. Abaqus/CAE highlights only the edges of a face when highlighting a surface and a face together. The following objects are supported:
For the MDB
ConstrainedSketchVertex
Edge
Face
Surface
Cell
Node
Element
Element face
Element edge
Feature
Datum
Instance
Set
Load
Boundary condition
Predefined field
Display group
For the ODB
Node
Element
Display group
- unhighlight(object)[source]¶
This method removes highlighting from an object in the current viewport.
Note
This function can be accessed by:
unhighlight
Note
- class ImageOptions[source]¶
Bases:
_CopyOptionsBase
The ImageOptions object stores settings that control how an image is rendered in a particular viewport. ImageOptions objects are accessed from the image options associated with a particular viewport. The ImageOptions object has no constructor; Abaqus creates the imageOptions member for a viewport when the viewport is created using the values in the imageOptions member of the current viewport.
Note
This object can be accessed by:
session.viewports[name].imageOptions
Note
Member Details:
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'CENTER'
[source]¶ A SymbolicConstant specifying the relative position of the image in the viewport when positionMethod =AUTO_ALIGN. Possible values are:
BOTTOM_LEFT
BOTTOM_CENTER
BOTTOM_RIGHT
CENTER_LEFT
CENTER
CENTER_RIGHT
TOP_LEFT
TOP_CENTER
TOP_RIGHT
The default value is CENTER.
-
fitMethod : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'BEST_FIT'
[source]¶ A SymbolicConstant specifying which type of fit is performed to scale and position the image in the viewport. Possible values are:
BEST_FIT, specifying a mode where the image is scaled to completely fit within the viewport.
FIT_WIDTH, specifying a mode where the image width is scaled to match the viewport width.
FIT_HEIGHT, specifying a mode where the image height is scaled to match the viewport height.
The default value is BEST_FIT.
-
imageName : --is-rst--:py:class:`str` =
''
[source]¶ A String specifying the name of the image. A list of valid image names is in the images repository in the session object.
-
origin : --is-rst--:py:class:`~typing.Sequence`\ \[:py:class:`float`] =
(0.0, 0.0)
[source]¶ A pair of Floats specifying the X and Y offsets in millimeters from the lower-left corner of the viewport. The origin argument is ignored unless positionMethod =MANUAL. The default value is (0, 0).
-
positionMethod : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'FIT_TO_VIEWPORT'
[source]¶ A SymbolicConstant specifying which positioning method is used to determine how the image will be scaled and positioned in the viewport. Possible values are:
FIT_TO_VIEWPORT, specifying a display mode where the image is scaled to fit in the viewport using the specified fitMethod.
AUTO_ALIGN, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified alignment.
MANUAL, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified origin.
The default value is FIT_TO_VIEWPORT.
- setValues(
- imageName=
''
, - showImage=
0
, - positionMethod=
FIT_TO_VIEWPORT
, - fitMethod=
BEST_FIT
, - alignment=
CENTER
, - xScale=
1.0
, - yScale=
1.0
, - origin=
(0.0, 0.0)
, - translucency=
1.0
, - options=
None
, This method modifies the ImageOptions object.
Note
- Parameters:¶
- imageName=
''
¶ A String specifying the name of the image. A list of valid image names is in the images repository in the session object.
- showImage=
0
¶ A Boolean specifying whether an image should be displayed in the viewport background. The default value is OFF.
- positionMethod=
FIT_TO_VIEWPORT
¶ A SymbolicConstant specifying which positioning method is used to determine how the image will be scaled and positioned in the viewport. Possible values are:
FIT_TO_VIEWPORT, specifying a display mode where the image is scaled to fit in the viewport using the specified fitMethod.
AUTO_ALIGN, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified alignment.
MANUAL, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified origin.
The default value is FIT_TO_VIEWPORT.
- fitMethod=
BEST_FIT
¶ A SymbolicConstant specifying which type of fit is performed to scale and position the image in the viewport when positionMethod =FIT_TO_VIEWPORT. Possible values are:
BEST_FIT, specifying a mode where the image is scaled to completely fit within the viewport.
FIT_WIDTH, specifying a mode where the image width is scaled to match the viewport width.
FIT_HEIGHT, specifying a mode where the image height is scaled to match the viewport height.
The default value is BEST_FIT.
- alignment=
CENTER
¶ A SymbolicConstant specifying the relative position of the image in the viewport when positionMethod =AUTO_ALIGN. Possible values are:
BOTTOM_LEFT
BOTTOM_CENTER
BOTTOM_RIGHT
CENTER_LEFT
CENTER
CENTER_RIGHT
TOP_LEFT
TOP_CENTER
TOP_RIGHT
The default value is CENTER.
- xScale=
1.0
¶ A Float specifying the scale applied to the image width. The xScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When xScale is negative, the image is mirrored about its y-axis but its position is not affected.
- yScale=
1.0
¶ A Float specifying the scale applied to the image height. The yScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When yScale is negative, the image is mirrored about its x-axis but its position is not affected.
- origin=
(0.0, 0.0)
¶ A pair of Floats specifying the X and Y offsets in millimeters from the lower-left corner of the viewport. The origin argument is ignored unless positionMethod =MANUAL. The default value is (0, 0).
- translucency=
1.0
¶ A Float specifying the translucency factor to use when displaying the image. Possible values are 0.0 ≤ translucency ≤ 1.0 with 0.0 being invisible and 1.0 being opaque. The default value is 1.0.
- options=
None
¶ None or an ImageOptions object specifying the object from which values are to be copied. If other arguments are also supplied to setValues, they will override the values in the options member. The default value is None.
- imageName=
- Raises:¶
RangeError –
-
showImage : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[source]¶ A Boolean specifying whether an image should be displayed in the viewport background. The default value is OFF.
-
translucency : --is-rst--:py:class:`float` =
1.0
[source]¶ A Float specifying the translucency factor to use when displaying the image. Possible values are 0.0 ≤ translucency ≤ 1.0 with 0.0 being invisible and 1.0 being opaque. The default value is 1.0.
-
xScale : --is-rst--:py:class:`float` =
1.0
[source]¶ A Float specifying the scale applied to the image width. The xScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When xScale is negative, the image is mirrored about its y-axis but its position is not affected.
-
yScale : --is-rst--:py:class:`float` =
1.0
[source]¶ A Float specifying the scale applied to the image height. The yScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When yScale is negative, the image is mirrored about its x-axis but its position is not affected.
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
-
class Layer(name, copyViewName=
''
)[source]¶ Bases:
object
Objects can be superimposed by displaying them in different layers of a viewport.
Note
This object can be accessed by:
session.viewports[name].layers[name]
Note
Check Layer on help.3ds.com/2017.
Member Details:
-
assemblyDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions` =
<abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions object>
[source]¶ An AssemblyDisplayOptions object specifying the display options for the Assembly object.
-
copyViewName : --is-rst--:py:class:`str` =
''
[source]¶ A String specifying the name of the layer to copy.
-
displayedObject : --is-rst--:py:class:`~abaqus.Canvas.Displayable.Displayable` =
<abaqus.Canvas.Displayable.Displayable object>
[source]¶ A Displayable object specifying the object to be displayed. The Displayable type is an abstract generalization. The concrete possible types are Part, Assembly, ConstrainedSketch, Odb, or XYPlot.
- moveAfter(name)[source]¶
This method moves the layer object after another object in the layer repository.
Note
- moveBefore(name)[source]¶
This method moves the layer object before another object in the layer repository.
Note
-
odbDisplay : --is-rst--:py:class:`~abaqus.OdbDisplay.OdbDisplay.OdbDisplay` =
<abaqus.OdbDisplay.OdbDisplay.OdbDisplay object>
[source]¶ An OdbDisplay object specifying the display options for the Odb object.
-
assemblyDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions` =
- class MovieOptions[source]¶
Bases:
_CopyOptionsBase
The MovieOptions object stores settings that control how the movie background for an animation is rendered in a particular viewport. MovieOptions objects are accessed from the movie options associated with a particular viewport. The MovieOptions object has no constructor; Abaqus creates the movieOptions member for a viewport when the viewport is created using the values in the movieOptions member of the current viewport.
Note
This object can be accessed by:
session.viewports[name].movieOptions
Note
Member Details:
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'CENTER'
[source]¶ A SymbolicConstant specifying the relative position of the image in the viewport when positionMethod =AUTO_ALIGN. Possible values are:
BOTTOM_LEFT
BOTTOM_CENTER
BOTTOM_RIGHT
CENTER_LEFT
CENTER
CENTER_RIGHT
TOP_LEFT
TOP_CENTER
TOP_RIGHT
The default value is CENTER.
-
fitMethod : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'BEST_FIT'
[source]¶ A SymbolicConstant specifying which type of fit is performed to scale and position the image in the viewport. Possible values are:
BEST_FIT, specifying a mode where the image is scaled to completely fit within the viewport.
FIT_WIDTH, specifying a mode where the image width is scaled to match the viewport width.
FIT_HEIGHT, specifying a mode where the image height is scaled to match the viewport height.
The default value is BEST_FIT.
-
movieName : --is-rst--:py:class:`str` =
''
[source]¶ A String specifying the name of the movie. A list of valid movie names is in the movies repository in the session object.
-
origin : --is-rst--:py:class:`~typing.Sequence`\ \[:py:class:`float`] =
(0.0, 0.0)
[source]¶ A pair of Floats specifying the X and Y offsets in millimeters from the lower-left corner of the viewport. The origin argument is ignored unless positionMethod =MANUAL. The default value is (0, 0).
-
positionMethod : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'FIT_TO_VIEWPORT'
[source]¶ A SymbolicConstant specifying which positioning method is used to determine how the image will be scaled and positioned in the viewport. Possible values are:
FIT_TO_VIEWPORT, specifying a display mode where the image is scaled to fit in the viewport using the specified fitMethod.
AUTO_ALIGN, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified alignment.
MANUAL, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified origin.
The default value is FIT_TO_VIEWPORT.
- setValues(
- movieName=
''
, - showMovie=
0
, - positionMethod=
FIT_TO_VIEWPORT
, - fitMethod=
BEST_FIT
, - alignment=
CENTER
, - xScale=
1.0
, - yScale=
1.0
, - origin=
(0.0, 0.0)
, - translucency=
1.0
, - options=
None
, This method modifies the MovieOptions object.
Note
- Parameters:¶
- movieName=
''
¶ A String specifying the name of the movie. A list of valid movie names is in the movies repository in the session object.
- showMovie=
0
¶ A Boolean specifying whether a movie should be displayed in the viewport during an animation. The default value is OFF.
- positionMethod=
FIT_TO_VIEWPORT
¶ A SymbolicConstant specifying which positioning method is used to determine how the image will be scaled and positioned in the viewport. Possible values are:
FIT_TO_VIEWPORT, specifying a display mode where the image is scaled to fit in the viewport using the specified fitMethod.
AUTO_ALIGN, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified alignment.
MANUAL, specifying a display mode where the image is scaled as specified by xScale and yScale and then positioned in the viewport using the specified origin.
The default value is FIT_TO_VIEWPORT.
- fitMethod=
BEST_FIT
¶ A SymbolicConstant specifying which type of fit is performed to scale and position the image in the viewport when positionMethod =FIT_TO_VIEWPORT. Possible values are:
BEST_FIT, specifying a mode where the image is scaled to completely fit within the viewport.
FIT_WIDTH, specifying a mode where the image width is scaled to match the viewport width.
FIT_HEIGHT, specifying a mode where the image height is scaled to match the viewport height.
The default value is BEST_FIT.
- alignment=
CENTER
¶ A SymbolicConstant specifying the relative position of the image in the viewport when positionMethod =AUTO_ALIGN. Possible values are:
BOTTOM_LEFT
BOTTOM_CENTER
BOTTOM_RIGHT
CENTER_LEFT
CENTER
CENTER_RIGHT
TOP_LEFT
TOP_CENTER
TOP_RIGHT
The default value is CENTER.
- xScale=
1.0
¶ A Float specifying the scale applied to the movie frame width. The xScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When xScale is negative, the movie frame is mirrored about its y-axis but its position is not affected.
- yScale=
1.0
¶ A Float specifying the scale applied to the movie frame height. The yScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When yScale is negative, the movie frame is mirrored about its x-axis but its position is not affected.
- origin=
(0.0, 0.0)
¶ A pair of Floats specifying the*X*- and Y offsets in millimeters from the lower-left corner of the viewport. The origin argument is ignored unless positionMethod =MANUAL. The default value is (0, 0).
- translucency=
1.0
¶ A Float specifying the translucency factor to use when displaying the movie frame. Possible values are 0.0 ≤ translucency ≤ 1.0 with 0.0 being invisible and 1.0 being opaque. The default value is 1.0.
- options=
None
¶ None or a MovieOptions object specifying the object from which values are to be copied. If other arguments are also supplied to setValues, they will override the values in the options member. The default value is None.
- movieName=
- Raises:¶
RangeError –
-
showMovie : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[source]¶ A Boolean specifying whether a movie should be displayed in the viewport during an animation. The default value is OFF.
-
translucency : --is-rst--:py:class:`float` =
1.0
[source]¶ A Float specifying the translucency factor to use when displaying the image. Possible values are 0.0 ≤ translucency ≤ 1.0 with 0.0 being invisible and 1.0 being opaque. The default value is 1.0.
-
xScale : --is-rst--:py:class:`float` =
1.0
[source]¶ A Float specifying the scale applied to the image width. The xScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When xScale is negative, the image is mirrored about its y-axis but its position is not affected.
-
yScale : --is-rst--:py:class:`float` =
1.0
[source]¶ A Float specifying the scale applied to the image height. The yScale argument is ignored when positionMethod =FIT_TO_VIEWPORT. The default value is 1.0.When yScale is negative, the image is mirrored about its x-axis but its position is not affected.
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
- class ViewportBase(
- name,
- origin=
(0.0, 0.0)
, - width=
120.0
, - height=
80.0
, - border=
1
, - titleBar=
1
, - titleStyle=
SYSTEM
, - customTitleString=
''
, Bases:
_OptionsBase
A viewport is the container for the graphics generated by the application. TheViewport object stores the various settings that determine how objects are displayed within that viewport.
Note
This object can be accessed by:
session.viewports[name]
Note
Member Details:
-
activeColorModes : --is-rst--:py:data:`~typing.Literal`\ \[``DEFAULT_COLORS``, ``PART_GEOM_MAP_COLORS``, ``ASSEMBLY_MAP_COLORS``, ``PART_MAP_COLORS``, ``INSTANCE_MAP_COLORS``, ``INSTANCE_TYPE_MAP_COLORS``, ``SECTION_MAP_COLORS``, ``MATERIAL_MAP_COLORS``, ``LOAD_MAP_COLORS``, ``BC_MAP_COLORS``, ``INTERACTION_MAP_COLORS``, ``CONSTRAINT_MAP_COLORS``, ``SET_MAP_COLORS``, ``SURFACE_MAP_COLORS``, ``INTERNAL_SET_MAP_COLORS``, ``INTERNAL_SURFACE_MAP_COLORS``, ``DISPLAY_GRP_MAP_COLORS``, ``SELECTION_GRP_MAP_COLORS``, ``ELTYPE_MAP_COLORS``, ``PLOT_MAP_COLORS``, ``MESH_MAP_COLORS``] =
'DEFAULT_COLORS'
[source]¶ A SymbolicConstant specifying the currently active color mappings. Possible values are: DEFAULT_COLORS PART_GEOM_MAP_COLORS ASSEMBLY_MAP_COLORS PART_MAP_COLORS INSTANCE_MAP_COLORS INSTANCE_TYPE_MAP_COLORS SECTION_MAP_COLORS MATERIAL_MAP_COLORS LOAD_MAP_COLORS BC_MAP_COLORS INTERACTION_MAP_COLORS CONSTRAINT_MAP_COLORS SET_MAP_COLORS SURFACE_MAP_COLORS INTERNAL_SET_MAP_COLORS INTERNAL_SURFACE_MAP_COLORS DISPLAY_GRP_MAP_COLORS SELECTION_GRP_MAP_COLORS ELTYPE_MAP_COLORS PLOT_MAP_COLORS MESH_MAP_COLORS The default value is DEFAULT_COLORS.
-
addDrawings(names=
()
)[source]¶ This method identifies the names of Drawing objects to be rendered in the Viewport.
Note
-
animationConnect : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[source]¶ A Boolean specifying whether an animation is connected to the viewport.
-
annotationsToPlot : --is-rst--:py:class:`~abaqus.Annotation.AnnotationsToPlotArray.AnnotationsToPlotArray` =
[]
[source]¶ An AnnotationsToPlotArray object.
-
applyLinkedCommands : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
1
[source]¶ A Boolean specifying whether the viewport is linked for synchronization. The default value is ON.
-
assemblyDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions` =
<abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions object>
[source]¶ An AssemblyDisplayOptions object specifying the display options for the Assembly object.
-
border : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
1
[source]¶ A Boolean specifying whether the viewport border is visible in a printed image. The default value is ON.
-
colorMappings : --is-rst--:py:class:`dict`\ \[:py:class:`str`, :py:class:`~abaqus.Canvas.AttributeColorMap.AttributeColorMap`] =
{}
[source]¶ A repository of AttributeColorMap objects specifying the objects cannot be constructed but the following attribute maps are supported:
“type”
“Element set”
“Material”
“Section”
“Default”
“Part”
“Part instance”
“Element type”
“Averaging region”
“Assembly”
“Property”
“Set”
“Surface”
“Skin”
“Profile”
“Part shape”
“Part status”
“Part geometry”
“Meshability”
“Instance type”
“Load”
“Boundary condition”
“Interaction”
“Constraint”
“Interaction type”
“Constraint type”
“Display group”
“Selection group”
“Interaction property”
“Connector”
“Connector type”
“Connector property”
“Internal set”
“Internal surface”
“mapColors”
“autoColors”
“overrides”
“defaultAutoColors”
“defaultOverrides”
“objectToCopy”
“colorMapping”
“colorMappings”
“colorMode”
“attributeColors”
“updateOverrides”
“colorCodeOverride”
“initialColor”
“Layup”
“Ply”
-
colorMode : --is-rst--:py:data:`~typing.Literal`\ \[``DEFAULT_COLORS``, ``PART_GEOM_MAP_COLORS``, ``ASSEMBLY_MAP_COLORS``, ``PART_MAP_COLORS``, ``INSTANCE_MAP_COLORS``, ``INSTANCE_TYPE_MAP_COLORS``, ``SECTION_MAP_COLORS``, ``MATERIAL_MAP_COLORS``, ``LOAD_MAP_COLORS``, ``BC_MAP_COLORS``, ``INTERACTION_MAP_COLORS``, ``CONSTRAINT_MAP_COLORS``, ``SET_MAP_COLORS``, ``SURFACE_MAP_COLORS``, ``INTERNAL_SET_MAP_COLORS``, ``INTERNAL_SURFACE_MAP_COLORS``, ``DISPLAY_GRP_MAP_COLORS``, ``SELECTION_GRP_MAP_COLORS``, ``ELTYPE_MAP_COLORS``, ``PLOT_MAP_COLORS``, ``MESH_MAP_COLORS``] =
'DEFAULT_COLORS'
[source]¶ A SymbolicConstant specifying the last applied color mapping. Possible values are: DEFAULT_COLORS PART_GEOM_MAP_COLORS ASSEMBLY_MAP_COLORS PART_MAP_COLORS INSTANCE_MAP_COLORS INSTANCE_TYPE_MAP_COLORS SECTION_MAP_COLORS MATERIAL_MAP_COLORS LOAD_MAP_COLORS BC_MAP_COLORS INTERACTION_MAP_COLORS CONSTRAINT_MAP_COLORS SET_MAP_COLORS SURFACE_MAP_COLORS INTERNAL_SET_MAP_COLORS INTERNAL_SURFACE_MAP_COLORS DISPLAY_GRP_MAP_COLORS SELECTION_GRP_MAP_COLORS ELTYPE_MAP_COLORS PLOT_MAP_COLORS MESH_MAP_COLORS The default value is DEFAULT_COLORS.
-
currentHeight : --is-rst--:py:class:`float` | :py:obj:`None` =
None
[source]¶ A Float specifying the height in millimeters of the current viewport, regardless of the value of windowState, and including the title bar.
-
currentLayer : --is-rst--:py:class:`str` =
''
[source]¶ A String specifying which layer is affected by options settings when displayMode =OVERLAY. The current layer is also the only layer affected by view manipulations when*viewManipLayers* =CURRENT.
-
currentOrigin : --is-rst--:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`] =
(0.0, 0.0)
[source]¶ A pair of Floats specifying the X and Y coordinates in millimeters in the canvas coordinate system of the lower left corner of the current viewport, regardless of the value of windowState.
-
currentWidth : --is-rst--:py:class:`float` | :py:obj:`None` =
None
[source]¶ A Float specifying the width in millimeters of the current viewport, regardless of the value of windowState.
-
customTitleString : --is-rst--:py:class:`str` =
''
[source]¶ A String specifying the viewport title when titleStyle =CUSTOM. The default value is an empty string.
-
detailPlotOptions : --is-rst--:py:class:`~abaqus.PlotOptions.DetailPlotOptions.DetailPlotOptions` =
<abaqus.PlotOptions.DetailPlotOptions.DetailPlotOptions object>
[source]¶ A DetailPlotOptions object.
- disableColorCodeUpdates()[source]¶
This method disables Viewport updates and internal computations triggered because of color coding.
Performance improvement will be significant when color coding is ON and repeating operations are performed using a script each of which requires color code updates. No benefit will be had when color coding is OFF.
- disableMultipleColors()[source]¶
This method disables applying multiple color mappings that was enabled using enableMultipleColors.
- disableRefresh()[source]¶
This method disables Viewport refresh.
Some methods that require the Viewport to be up-to-date will override this setting. It is advisable to use this method sparingly.
- displayMode : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant`[source]¶
A SymbolicConstant specifying the display mode of the viewport. Possible values are:SINGLE, specifying a single displayedObject.OVERLAY, specifying one or more layers to be displayed simultaneously—each layer contains one displayedObject.
-
displayedObject : --is-rst--:py:class:`~abaqus.Canvas.Displayable.Displayable` =
<abaqus.Canvas.Displayable.Displayable object>
[source]¶ A Displayable object specifying the object to be displayed. The Displayable type is an abstract generalization. The concrete possible types are Part, Assembly, ConstrainedSketch, Odb, PlyStackPlot, or XYPlot. If displayedObject = None, Abaqus displays an empty viewport.
-
drawings : --is-rst--:py:class:`tuple`\ \[:py:class:`str`, :py:data:`...<Ellipsis>`] =
()
[source]¶ A tuple of Strings specifying keys to the session.drawings repository. The default value is an empty sequence.
- enableColorCodeUpdates()[source]¶
This method enables Viewport color code updates disabled using disableColorCodeUpdates.
- enableMultipleColors()[source]¶
This method enables multiple color mappings to be applied at the same time.
It also ensures that the Viewport is updated correctly when initialColor is set.
- forceRefresh()[source]¶
This method causes the Viewport to refresh immediately.
It is provided to allow scripts to refresh the Viewport before the script terminates. Normally, there would only be a single cumulative refresh that takes place immediately after the script completes.
-
getActiveElementLabels(useCut=
0
, printResults=0
)[source]¶ This method returns the element labels currently active in the viewport based on the current display group. The element labels are printed only when the displayedObject member in the Viewport object is set to an Odb. The getActiveElementLabels method has the following arguments:
-
getActiveNodeLabels(useCut=
0
, printResults=0
)[source]¶ This method returns the node labels currently active in the viewport based on the current display group. The node labels are printed only when the displayedObject member in the Viewport object is set to an Odb. The getActiveNodeLabels method has the following arguments:
- getPrimVarMinMaxLoc()[source]¶
This method returns a dictionary containing the minimum, maximum and their location for the current primary variable. A contour plot should be displayed in the current viewport or else the method will return None.
-
height : --is-rst--:py:class:`float` =
80.0
[source]¶ A Float specifying the height in millimeters of the viewport. This height includes the title bar. Possible values are 30 ≤ height ≤ (maxHeight). The default value is 80.0. Note: The maximum value of height (maxHeight) is the height of the screen in millimeters.
-
iconOrigin : --is-rst--:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`] =
(0.0, 0.0)
[source]¶ A pair of Floats specifying the X and Y coordinates in millimeters of the lower left corner of the current viewport from a coordinate system having its origin in the lower left corner of the drawing area. This origin refers to the viewport location when windowState =MINIMIZED.
-
imageOptions : --is-rst--:py:class:`~abaqus.Canvas.ImageOptions.ImageOptions` =
<abaqus.Canvas.ImageOptions.ImageOptions object>
[source]¶ An ImageOptions object.
-
initialColor : --is-rst--:py:class:`str` =
''
[source]¶ A String specifying the color that will be applied to all objects in the viewport at the start of color coding. The possible values are ‘As is’, ‘Default’ or a string with a hexadecimal representation of a color.
-
layerOffset : --is-rst--:py:class:`float` | :py:obj:`None` =
None
[source]¶ A Float specifying a factor to be used in offsetting layers in the screen Z direction. Possible values are -1 to 1. A negative value reverses the apparent order in which the layers are plotted.
-
layers : --is-rst--:py:class:`dict`\ \[:py:class:`str`, :py:class:`~abaqus.Canvas.Layer.Layer`] =
{}
[source]¶ A repository of Layer objects specifying the key to the repository is a String with the name of the layer.
-
lightOptions : --is-rst--:py:class:`~abaqus.DisplayOptions.LightOptions.LightOptions` =
<abaqus.DisplayOptions.LightOptions.LightOptions object>
[source]¶ A LightOptions object.
- minimize()[source]¶
This method minimizes the Viewport object to appear as an abbreviated title bar.
-
movieOptions : --is-rst--:py:class:`~abaqus.Canvas.MovieOptions.MovieOptions` =
<abaqus.Canvas.MovieOptions.MovieOptions object>
[source]¶ A MovieOptions object.
-
odbDisplay : --is-rst--:py:class:`~abaqus.OdbDisplay.OdbDisplay.OdbDisplay` =
<abaqus.OdbDisplay.OdbDisplay.OdbDisplay object>
[source]¶ An OdbDisplay object specifying the display options for the Odb object.
-
offset(deltaX=
0
, deltaY=0
)[source]¶ This method modifies the current X Y location of the viewport by the specified distance.
Note
-
origin : --is-rst--:py:class:`~typing.Sequence`\ \[:py:class:`float`] =
(0.0, 0.0)
[source]¶ A pair of Floats specifying the X and Y coordinates in millimeters in the canvas coordinate system of the lower left corner of the viewport. The default origin is (0, 0).
-
partDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.PartDisplayOptions.PartDisplayOptions` =
<abaqus.DisplayOptions.PartDisplayOptions.PartDisplayOptions object>
[source]¶ A PartDisplayOptions object specifying the display options for the Part object.
-
removeDrawings(names=
()
)[source]¶ This method identifies the names of Drawing objects to no longer be rendered in the Viewport.
Note
- restore()[source]¶
This method restores a maximized or minimized Viewport object to its previous size and location.
-
setColor(initialColor: str, translucency: str =
''
)[source]¶ - setColor(colorMapping: AttributeColorMap)
- setColor(
- leaf: Leaf,
- edgeColorWireHide: str =
''
, - edgeColorFillShade: str =
''
, - setColor(*args, **kwargs)
- setValues(
- displayedObject=
None
, - displayMode=
None
, - visibleLayers=
()
, - viewManipLayers=
None
, - currentLayer=
''
, - layerOffset=
None
, This method modifies the Viewport object. The arguments to setValues are the same as the arguments to the Viewport method, except for the name argument. In addition, the setValues method has the following arguments:
Note
- Parameters:¶
- displayedObject=
None
¶ A Displayable object specifying the object to be displayed. The Displayable type is an abstract generalization. The concrete possible types are Part, Assembly, ConstrainedSketch, Odb, PlyStackPlot, or XYPlot. If displayedObject = None, Abaqus displays an empty viewport.
- displayMode=
None
¶ A SymbolicConstant specifying the display mode of the viewport. Possible values are:
SINGLE, specifying a single displayedObject.
OVERLAY, specifying one or more layers to be displayed simultaneously—each layer contains one displayedObject.
- visibleLayers=
()
¶ A sequence of Strings specifying the names of layers that will be displayed in the viewport when displayMode = OVERLAY.
- viewManipLayers=
None
¶ A SymbolicConstant specifying which layer or layers will be controlled by the view manipulation tools when displayMode = OVERLAY. Possible values are ALL and CURRENT.
- currentLayer=
''
¶ A String specifying which layer is affected by options settings when displayMode =OVERLAY. The current layer is also the only layer affected by view manipulations when*viewManipLayers* =CURRENT.
- layerOffset=
None
¶ A Float specifying a factor to be used in offsetting layers in the screen Z direction. Possible values are -1 to 1. A negative value reverses the apparent order in which the layers are plotted.
- displayedObject=
- Raises:¶
RangeError –
-
timeDisplay(numFrames=
0
, numSeconds=10
, degreesPerFrame=0
)[source]¶ This method refreshes the Viewport display numFrames times and then checks to see if numSeconds seconds have elapsed. If not, it will continue refreshing the Viewport until the time has elapsed. At completion, the actual number of refreshes (frames) rendered and elapsed time will be reported along with the calculated frames-per-second (fps).
Note
- Parameters:¶
- numFrames=
0
¶ An Int specifying the minimum number of times to refresh the Viewport. The default value is 0.
- numSeconds=
10
¶ An Int specifying the minimum number of seconds to spend refreshing the Viewport. The default value is 10.
- degreesPerFrame=
0
¶ A Float specifying the number of degrees to rotate the model view about its Z axis before each refresh. The default value is 0.0.
- numFrames=
-
titleBar : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
1
[source]¶ A Boolean specifying whether the viewport title should be displayed in a printed image. The default value is ON.If border = OFF, the title will not be visible, even if titleBar =ON.
-
titleStyle : --is-rst--:py:data:`~typing.Literal`\ \[``CUSTOM``, ``SYSTEM``] =
'SYSTEM'
[source]¶ A SymbolicConstant specifying which title to use for the viewport title. Possible values are CUSTOM and SYSTEM. The default value is SYSTEM.If titleStyle = CUSTOM, customTitleString will be used. If titleStyle = SYSTEM, a system-generated string will be used.
-
translucency : --is-rst--:py:class:`float` | :py:obj:`None` =
None
[source]¶ A Float specifying the translucency that will be applied to objects colored using initialColor and it needs to be set along with initialColor. If initialColor is set to ‘As is’ then translucency will have no effect.
- view : --is-rst--:py:class:`~abaqus.UtilityAndView.View.View`[source]¶
A View object specifying the object that controls viewing of the viewport content.
- viewManipLayers : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant`[source]¶
A SymbolicConstant specifying which layer or layers will be controlled by the view manipulation tools when displayMode = OVERLAY. Possible values are ALL and CURRENT.
-
viewportAnnotationOptions : --is-rst--:py:class:`~abaqus.DisplayOptions.ViewportAnnotationOptions.ViewportAnnotationOptions` =
<abaqus.DisplayOptions.ViewportAnnotationOptions.ViewportAnnotationOptions object>
[source]¶ A ViewportAnnotationOptions object.
-
visibleLayers : --is-rst--:py:class:`tuple`\ \[:py:class:`str`, :py:data:`...<Ellipsis>`] =
()
[source]¶ A tuple of Strings specifying the names of layers that will be displayed in the viewport when displayMode = OVERLAY.
-
activeColorModes : --is-rst--:py:data:`~typing.Literal`\ \[``DEFAULT_COLORS``, ``PART_GEOM_MAP_COLORS``, ``ASSEMBLY_MAP_COLORS``, ``PART_MAP_COLORS``, ``INSTANCE_MAP_COLORS``, ``INSTANCE_TYPE_MAP_COLORS``, ``SECTION_MAP_COLORS``, ``MATERIAL_MAP_COLORS``, ``LOAD_MAP_COLORS``, ``BC_MAP_COLORS``, ``INTERACTION_MAP_COLORS``, ``CONSTRAINT_MAP_COLORS``, ``SET_MAP_COLORS``, ``SURFACE_MAP_COLORS``, ``INTERNAL_SET_MAP_COLORS``, ``INTERNAL_SURFACE_MAP_COLORS``, ``DISPLAY_GRP_MAP_COLORS``, ``SELECTION_GRP_MAP_COLORS``, ``ELTYPE_MAP_COLORS``, ``PLOT_MAP_COLORS``, ``MESH_MAP_COLORS``] =