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=
''
, -
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.
An AnimationController 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=
''
)[源代码]¶ This method creates a Layer object in the Layer repository.
备注
This function can be accessed by:
session.viewports[name].Layer
备注
Check Layer on help.3ds.com/2024.
-
Layer(name, copyViewName=
Other Classes¶
- class AttributeColorMap[源代码]¶
基类:
_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.
备注
This object can be accessed by:
session.viewports[name].colorMappings[name]
备注
Member Details:
-
attributeColors : --is-rst--:py:class:`dict` | :py:obj:`None` =
None
[源代码]¶ 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
[源代码]¶ 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`[源代码]¶
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
)[源代码]¶ This method modifies the AttributeColorMap object.
- 参数:¶
- 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
)[源代码]¶ This method specifies additional overrides to be added to the current object definition.
- 参数:¶
- 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[源代码]¶
基类:
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.
备注
This function can be accessed by:
session.Viewport
备注
- 参数:¶
- 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.
- 返回:¶
A Viewport object.
- 返回类型:¶
- 抛出:¶
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[源代码]¶
基类:
object
The DrawingArea object specifies the location and size of the drawing area used for placement of viewports.
备注
This object can be accessed by:
session.drawingArea
备注
Member Details:
- highlight(object)[源代码]¶
This method highlights an object in the current viewport.
备注
This function can be accessed by:
highlight
备注
- 参数:¶
- 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)[源代码]¶
This method removes highlighting from an object in the current viewport.
备注
This function can be accessed by:
unhighlight
- class ImageOptions[源代码]¶
基类:
_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.
备注
This object can be accessed by:
session.viewports[name].imageOptions
备注
Member Details:
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'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.
-
fitMethod : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'BEST_FIT'
[源代码]¶ 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` =
''
[源代码]¶ 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)
[源代码]¶ 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'
[源代码]¶ 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.
- 参数:¶
- 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=
- 抛出:¶
RangeError –
-
showImage : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[源代码]¶ 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
[源代码]¶ 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.
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
-
class Layer(name, copyViewName=
''
)[源代码]¶ 基类:
object
Objects can be superimposed by displaying them in different layers of a viewport.
备注
This object can be accessed by:
session.viewports[name].layers[name]
备注
Check Layer on help.3ds.com/2024.
Member Details:
-
assemblyDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions` =
<abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions object>
[源代码]¶ An AssemblyDisplayOptions object specifying the display options for the Assembly object.
-
copyViewName : --is-rst--:py:class:`str` =
''
[源代码]¶ A String specifying the name of the layer to copy.
-
displayedObject : --is-rst--:py:class:`~abaqus.Canvas.Displayable.Displayable` =
<abaqus.Canvas.Displayable.Displayable object>
[源代码]¶ 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)[源代码]¶
This method moves the layer object after another object in the layer repository.
备注
- moveBefore(name)[源代码]¶
This method moves the layer object before another object in the layer repository.
备注
-
odbDisplay : --is-rst--:py:class:`~abaqus.OdbDisplay.OdbDisplay.OdbDisplay` =
<abaqus.OdbDisplay.OdbDisplay.OdbDisplay object>
[源代码]¶ An OdbDisplay object specifying the display options for the Odb object.
-
assemblyDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.AssemblyDisplayOptions.AssemblyDisplayOptions` =
- class MovieOptions[源代码]¶
基类:
_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.
备注
This object can be accessed by:
session.viewports[name].movieOptions
备注
Member Details:
-
alignment : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'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.
-
fitMethod : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant` =
'BEST_FIT'
[源代码]¶ 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` =
''
[源代码]¶ 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)
[源代码]¶ 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'
[源代码]¶ 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.
- 参数:¶
- 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=
- 抛出:¶
RangeError –
-
showMovie : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[源代码]¶ 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
[源代码]¶ 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.
-
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=
''
, 基类:
_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.
备注
This object can be accessed by:
session.viewports[name]
备注
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'
[源代码]¶ 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=
()
)[源代码]¶ This method identifies the names of Drawing objects to be rendered in the Viewport.
-
animationConnect : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
0
[源代码]¶ A Boolean specifying whether an animation is connected to the viewport.
-
animationController : --is-rst--:py:class:`~abaqus.Animation.AnimationController.AnimationController` =
<abaqus.Animation.AnimationController.AnimationController object>
[源代码]¶ An AnimationController object.
Added in version 2020: The
animationController
attribute was added.
-
annotationsToPlot : --is-rst--:py:class:`~abaqus.Annotation.AnnotationsToPlotArray.AnnotationsToPlotArray` =
[]
[源代码]¶ An AnnotationsToPlotArray object.
-
applyLinkedCommands : --is-rst--:py:data:`~typing.Union`\ \[:py:class:`~abaqus.UtilityAndView.AbaqusBoolean.AbaqusBoolean`, :py:class:`bool`] =
1
[源代码]¶ 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>
[源代码]¶ 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
[源代码]¶ 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`] =
{}
[源代码]¶ 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'
[源代码]¶ 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
[源代码]¶ 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` =
''
[源代码]¶ 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:`~typing.Sequence`\ \[:py:class:`float`] =
()
[源代码]¶ 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
[源代码]¶ A Float specifying the width in millimeters of the current viewport, regardless of the value of windowState.
-
customTitleString : --is-rst--:py:class:`str` =
''
[源代码]¶ 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>
[源代码]¶ A DetailPlotOptions object.
- disableColorCodeUpdates()[源代码]¶
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()[源代码]¶
This method disables applying multiple color mappings that was enabled using enableMultipleColors.
- disableRefresh()[源代码]¶
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`[源代码]¶
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>
[源代码]¶ 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` =
()
[源代码]¶ A tuple of Strings specifying keys to the session.drawings repository. The default value is an empty sequence.
- enableColorCodeUpdates()[源代码]¶
This method enables Viewport color code updates disabled using disableColorCodeUpdates.
- enableMultipleColors()[源代码]¶
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()[源代码]¶
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
)[源代码]¶ 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
)[源代码]¶ 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()[源代码]¶
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
[源代码]¶ 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:`~typing.Sequence`\ \[:py:class:`float`] =
()
[源代码]¶ 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>
[源代码]¶ An ImageOptions object.
-
initialColor : --is-rst--:py:class:`str` =
''
[源代码]¶ 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
[源代码]¶ 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`] =
{}
[源代码]¶ 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>
[源代码]¶ A LightOptions object.
-
movieOptions : --is-rst--:py:class:`~abaqus.Canvas.MovieOptions.MovieOptions` =
<abaqus.Canvas.MovieOptions.MovieOptions object>
[源代码]¶ A MovieOptions object.
-
odbDisplay : --is-rst--:py:class:`~abaqus.OdbDisplay.OdbDisplay.OdbDisplay` =
<abaqus.OdbDisplay.OdbDisplay.OdbDisplay object>
[源代码]¶ An OdbDisplay object specifying the display options for the Odb object.
-
offset(deltaX=
0
, deltaY=0
)[源代码]¶ This method modifies the current X Y location of the viewport by the specified distance.
备注
-
origin : --is-rst--:py:class:`~typing.Sequence`\ \[:py:class:`float`] =
(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).
-
partDisplay : --is-rst--:py:class:`~abaqus.DisplayOptions.PartDisplayOptions.PartDisplayOptions` =
<abaqus.DisplayOptions.PartDisplayOptions.PartDisplayOptions object>
[源代码]¶ A PartDisplayOptions object specifying the display options for the Part object.
-
removeDrawings(names=
()
)[源代码]¶ This method identifies the names of Drawing objects to no longer be rendered in the Viewport.
- restore()[源代码]¶
This method restores a maximized or minimized Viewport object to its previous size and location.
-
setColor(initialColor: str, translucency: str =
''
)[源代码]¶ - 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:
- 参数:¶
- 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=
- 抛出:¶
RangeError –
-
timeDisplay(numFrames=
0
, numSeconds=10
, degreesPerFrame=0
)[源代码]¶ 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).
- 参数:¶
- 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
[源代码]¶ 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'
[源代码]¶ 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
[源代码]¶ 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`[源代码]¶
A View object specifying the object that controls viewing of the viewport content.
- viewManipLayers : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant`[源代码]¶
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>
[源代码]¶ A ViewportAnnotationOptions object.
-
visibleLayers : --is-rst--:py:class:`tuple` =
()
[源代码]¶ 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``] =