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='',
)[source]

Bases: AnnotationViewport

Public Data Attributes:

Inherited from ViewportBase

origin

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.

width

A Float specifying the width in millimeters of the viewport.

height

A Float specifying the height in millimeters of the viewport.

border

A Boolean specifying whether the viewport border is visible in a printed image.

titleBar

A Boolean specifying whether the viewport title should be displayed in a printed image.

titleStyle

A SymbolicConstant specifying which title to use for the viewport title.

customTitleString

A String specifying the viewport title when titleStyle =CUSTOM.

layerOffset

A Float specifying a factor to be used in offsetting layers in the screen Z direction.

currentWidth

A Float specifying the width in millimeters of the current viewport, regardless of the value of windowState.

currentHeight

A Float specifying the height in millimeters of the current viewport, regardless of the value of windowState, and including the title bar.

applyLinkedCommands

A Boolean specifying whether the viewport is linked for synchronization.

activeColorModes

A SymbolicConstant specifying the currently active color mappings.

colorMode

A SymbolicConstant specifying the last applied color mapping.

translucency

A Float specifying the translucency that will be applied to objects colored using initialColor and it needs to be set along with initialColor.

animationConnect

A Boolean specifying whether an animation is connected to the viewport.

colorMappings

A repository of AttributeColorMap objects specifying the objects cannot be constructed but the following attribute maps are supported:

initialColor

A String specifying the color that will be applied to all objects in the viewport at the start of color coding.

currentLayer

A String specifying which layer is affected by options settings when displayMode =OVERLAY.

displayedObject

A Displayable object specifying the object to be displayed.

layers

A repository of Layer objects specifying the key to the repository is a String with the name of the layer.

odbDisplay

An OdbDisplay object specifying the display options for the Odb object.

partDisplay

A PartDisplayOptions object specifying the display options for the Part object.

assemblyDisplay

An AssemblyDisplayOptions object specifying the display options for the Assembly object.

viewportAnnotationOptions

A ViewportAnnotationOptions object.

detailPlotOptions

A DetailPlotOptions object.

annotationsToPlot

An AnnotationsToPlotArray object.

visibleLayers

A tuple of Strings specifying the names of layers that will be displayed in the viewport when displayMode = OVERLAY.

currentOrigin

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.

iconOrigin

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.

lightOptions

A LightOptions object.

imageOptions

An ImageOptions object.

movieOptions

A MovieOptions object.

animationController

An AnimationController object.

drawings

A tuple of Strings specifying keys to the session.drawings repository.

name

A String specifying the repository key.

displayMode

A SymbolicConstant specifying the display mode of the viewport.

viewManipLayers

A SymbolicConstant specifying which layer or layers will be controlled by the view manipulation tools when displayMode = OVERLAY.

windowState

A SymbolicConstant specifying the current state of a viewport.

view

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.

bringToFront()

This method moves the Viewport object to the front.

disableMultipleColors()

This method disables applying multiple color mappings that was enabled using enableMultipleColors.

disableRefresh()

This method disables Viewport refresh.

disableColorCodeUpdates()

This method disables Viewport updates and internal computations triggered because of color coding.

enableMultipleColors()

This method enables multiple color mappings to be applied at the same time.

enableRefresh()

This method enables Viewport refresh disabled using disableRefresh.

enableColorCodeUpdates()

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.

getPrimVarMinMaxLoc()

This method returns a dictionary containing the minimum, maximum and their location for the current primary variable.

makeCurrent()

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.

sendToBack()

This method moves the Viewport object to the back.

setColor()

forceRefresh()

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
Parameters:
name

A String specifying the repository key.

copyViewName=''

A String specifying the name of the layer to copy.

Returns:

A Layer object.

Return type:

Layer

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]

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.

overrides : --is-rst--:py:class:`dict` | :py:obj:`None` = None[source]
setDefaults()[source]

This method resets the AttributeColorMap object to its default state.

setValues(overrides=None, defaultOverrides=None)[source]

This method modifies the AttributeColorMap object.

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.

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.

class Canvas[source]

Bases: object

Member Details:

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='',
)[source]

This method creates a Viewport object with the specified origin and dimensions.

Note

This function can be accessed by:

session.Viewport
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:

Viewport

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 Displayable[source]

Bases: object

Member Details:

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

Member Details:

height : --is-rst--:py:class:`float` | :py:obj:`None` = None[source]

A Float specifying the height in millimeters.

origin : --is-rst--:py:class:`~typing.Sequence`\ \[:py:class:`float`] = (0.0, 0.0)[source]

A pair of Floats specifying the coordinates of the bottom left hand corner in millimeters.

width : --is-rst--:py:class:`float` | :py:obj:`None` = None[source]

A Float specifying the width in millimeters.

highlight(object)[source]

This method highlights an object in the current viewport.

Note

This function can be accessed by:

highlight
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
Parameters:
object

An object specifying the object in the current viewport from which the highlighting will be removed. You can specify only a single object. See highlight for a list of supported objects.

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

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,
)[source]

This method modifies the ImageOptions object.

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.

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.

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]

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.

Parameters:
name

A String specifying the name of the other Layer object.

moveBefore(name)[source]

This method moves the layer object before another object in the layer repository.

Parameters:
name

A String specifying the name of the other Layer object.

name : --is-rst--:py:class:`str`[source]

A String specifying the repository key.

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.

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.

view : --is-rst--:py:class:`~abaqus.UtilityAndView.View.View` | :py:obj:`None` = None[source]

A View object specifying the object that controls viewing of the layer.

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

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,
)[source]

This method modifies the MovieOptions object.

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.

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.

class ViewportBase(
name,
origin=(0.0, 0.0),
width=120.0,
height=80.0,
border=1,
titleBar=1,
titleStyle=SYSTEM,
customTitleString='',
)[source]

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]

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.

Parameters:
names=()

A sequence of String values identifying keys in the session.drawings repository.

Raises:

ValueError

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.

animationController : --is-rst--:py:class:`~abaqus.Animation.AnimationController.AnimationController` = <abaqus.Animation.AnimationController.AnimationController object>[source]

An AnimationController object.

Added in version 2020: The animationController attribute was added.

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.

bringToFront()[source]

This method moves the Viewport object to the front.

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:`~typing.Sequence`\ \[:py:class:`float`] = ()[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` = ()[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.

enableRefresh()[source]

This method enables Viewport refresh disabled using disableRefresh.

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:

Parameters:
useCut=0

A Boolean flag to specify if any active cutting plane is to be considered in determining active elements.

printResults=0

A Boolean flag to specify if the active element labels are to be printed to the replay file.

Returns:

A Dictionary object of element labels, keyed by OdbInstance name. Returns None if the displayedObject member is not an Odb object.

Return type:

dict

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:

Parameters:
useCut=0

A Boolean flag to specify if any active cutting plane is to be considered in determining active nodes.

printResults=0

A Boolean flag to specify if the active node labels are to be printed to the replay file.

Returns:

A Dictionary object of node labels, keyed by OdbInstance name. Returns None if the displayedObject member is not an Odb object.

Return type:

dict

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.

Returns:

A dictionary with keys ‘minPartInstanceName’, ‘minElementLabel’, ‘minNodeLabel’, ‘minPosition’, ‘maxPartInstanceName’, ‘maxElementLabel’, ‘maxNodeLabel’, ‘maxPosition’ .

Return type:

dict

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:`~typing.Sequence`\ \[:py:class:`float`] = ()[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.

makeCurrent()[source]

This method makes theViewport object the current viewport.

maximize()[source]

This method maximizes the Viewport object to fill the drawing area.

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.

name : --is-rst--:py:class:`str`[source]

A String specifying the repository key.

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.

Parameters:
deltaX=0

A Float specifying the offset in millimeters of the X component of the viewport origin. The default value is 0.

deltaY=0

A Float specifying the offset in millimeters of the Y component of the viewport origin. The default value is 0.

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.

Parameters:
names=()

A sequence of String values identifying keys in the Viewport sequence.

Raises:

ValueError

restore()[source]

This method restores a maximized or minimized Viewport object to its previous size and location.

sendToBack()[source]

This method moves the Viewport object to the back.

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,
)[source]

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:

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.

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).

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.

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` = ()[source]

A tuple of Strings specifying the names of layers that will be displayed in the viewport when displayMode = OVERLAY.

width : --is-rst--:py:class:`float` = 120.0[source]

A Float specifying the width in millimeters of the viewport. Possible values are 30 ≤ width ≤ (maxWidth). The default value is 120. Note: The maximum value of width (maxWidth) is the width of the screen in millimeters.

windowState : --is-rst--:py:class:`~abaqus.UtilityAndView.SymbolicConstant.SymbolicConstant`[source]

A SymbolicConstant specifying the current state of a viewport. Possible values are NORMAL, MAXIMIZED, and MINIMIZED.