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.
session.viewports[name]
This method creates a Viewport object with the specified origin and dimensions.
session.Viewport
Required argument
A String specifying the repository key.
Optional arguments
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).
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.
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.
A Boolean specifying whether the viewport border is visible in a printed image. The default value is ON.
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.
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.
A String specifying the viewport title when titleStyle =CUSTOM. The default value is an empty string.
Return value
A Viewport object.
Exceptions
RangeError.
If the user attempts to delete the only viewport:
If width is out of range:
If height is out of range:
This method moves the Viewport object to the front.
Arguments
Return value
Exceptions
This method disables applying multiple color mappings that was enabled using enableMultipleColors
Arguments
Return value
Exceptions
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.
Arguments
Return value
Exceptions
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.
Arguments
Return value
Exceptions
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.
Arguments
Return value
Exceptions
This method enables Viewport refresh disabled using disableRefresh.
Arguments
Return value
Exceptions
This method enables Viewport color code updates disabled using disableColorCodeUpdates.
Arguments
Return value
Exceptions
This method returns the element labels currently active in the viewport based on the current display group and optionally based on any active cut if useCut is True. The labels will optionally be printed to the replay file if printResults is True. The getActiveElementLabels method has the following arguments:
Required arguments
Optional arguments
A Boolean flag to specify if any active cutting plane is to be considered in determining active elements.
A Boolean flag to specify if the active element labels are to be printed to the replay file.
Return value
A Dictionary object of labels for each active part instance.
Exceptions
This method returns the node labels currently active in the viewport based on the current display group and optionally based on any active cut if useCut is True. The labels will optionally be printed to the replay file ifprintResults is True. The getActiveNodeLabels method has the following arguments:
Required arguments
Optional arguments
A Boolean flag to specify if any active cutting plane is to be considered in determining active nodes.
A Boolean flag to specify if the active node labels are to be printed to the replay file.
Return value
A Dictionary object of labels for each active part instance.
Exceptions
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.
Arguments
Return value
A dictionary with keys 'minPartInstanceName', 'minElementLabel', 'minNodeLabel', 'minPosition', 'maxPartInstanceName', 'maxElementLabel', 'maxNodeLabel', 'maxPosition'
Exceptions
This method makes theViewport object the current viewport.
Arguments
Return value
Exceptions
This method maximizes the Viewport object to fill the drawing area.
Arguments
Return value
Exceptions
This method minimizes the Viewport object to appear as an abbreviated title bar.
Arguments
Return value
Exceptions
This method modifies the current X-Y location of the viewport by the specified distance.
Required arguments
Optional arguments
A Float specifying the offset in millimeters of the X-component of the viewport origin. The default value is 0.
A Float specifying the offset in millimeters of the Y-component of the viewport origin. The default value is 0.
Return value
Exceptions
This method restores a maximized or minimized Viewport object to its previous size and location.
Arguments
Return value
Exceptions
This method moves the Viewport object to the back.
Arguments
Return value
Exceptions
This method specifies the color assignment using initialColor and translucency. If initialColor has a value of 'As is', translucency has no effect. The setColor method has the following arguments:
Required argument
A string specifying the initial color applied to the objects.
Optional argument
A float in the range of 0.0 to 1.0 specifying how translucent the objects drawn using initialColor needs to be.
Return value
Exceptions
This method specifies the color assignment using attributes specified by an AttributeColorMap object. The setColor method has the following arguments:
Required argument
An AttributeColorMap object. Possible values are any AttributeColorMap object.
Optional arguments
Return value
Exceptions
This method specifies the color of a Leaf object.
Required argument
A Leaf object. Possible values are any Leaf object.
Optional arguments
At least one of the following must be provided:
A String specifying the color to be used for drawing the edges of the elements contained in leaf when the render style is wireframe or hidden.
A String specifying the color to be used for drawing the edges of the elements contained in leaf when the render style is filled or shaded.
A String specifying the color to be used for drawing the faces of the elements contained in leaf when the render style is filled or shaded.
A String specifying the color to be used for drawing the nodes contained in leaf.
A SymbolicConstant specifying the node symbol types for the nodes contained in leaf. Possible values areFILLED_CIRCLE, FILLED_SQUARE, FILLED_DIAMOND, FILLED_TRI, HOLLOW_CIRCLE, HOLLOW_SQUARE, HOLLOW_DIAMOND, HOLLOW_TRI, CROSS, and XMARKER. The default value is HOLLOW_CIRCLE.
A SymbolicConstant specifying the node symbol size for the nodes contained in leaf. Possible values are SMALL, MEDIUM, and LARGE. The default value is SMALL.
Return value
Exceptions
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.
Arguments
Return value
Exceptions
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:
Required arguments
Optional arguments
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.
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.
A sequence of Strings specifying the names of layers that will be displayed in the viewport when displayMode = OVERLAY.
A SymbolicConstant specifying which layer or layers will be controlled by the view manipulation tools when displayMode=OVERLAY. Possible values are ALL and CURRENT.
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 whenviewManipLayers =CURRENT.
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.
Return value
Exceptions
RangeError.
This method identifies the names of Drawing objects to be rendered in the Viewport.
Required arguments
Optional argument
A sequence of String values identifying keys in the session.drawings repository.
Return value
Exceptions
ValueError.
This method identifies the names of Drawing objects to no longer be rendered in the Viewport.
Required arguments
Optional argument
A sequence of String values identifying keys in the Viewport sequence.
Return value
Exceptions
ValueError.
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).
Required arguments
Optional arguments
An Int specifying the minimum number of times to refresh the Viewport. The default value is 0.
An Int specifying the minimum number of seconds to spend refreshing the Viewport. The default value is 10.
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.
Return value
Exceptions
The Viewport object has members with the same names and descriptions as the arguments to the Viewport method.
In addition, the Viewport object can have the following members:
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.
A SymbolicConstant specifying which layer or layers will be controlled by the view manipulation tools when displayMode=OVERLAY. Possible values are ALL and CURRENT.
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.
A SymbolicConstant specifying the current state of a viewport. Possible values are NORMAL, MAXIMIZED, and MINIMIZED.
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. The default value is ON.
A SymbolicConstant specifying the currently active color mappings. Possible values are:
The default value is DEFAULT_COLORS.
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
A SymbolicConstant specifying the last applied color mapping. Possible values are:
The default value is DEFAULT_COLORS.
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
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.
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:
"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"
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.
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 whenviewManipLayers =CURRENT.
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.
A repository of Layer objects specifying the key to the repository is a String with the name of the layer.
A View object specifying the object that controls viewing of the viewport content.
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. This origin refers to the viewport location when windowState =MINIMIZED.
A LightOptions object.
An ImageOptions object.
A MovieOptions object.
A tuple of Strings specifying keys to the session.drawings repository. The default value is an empty sequence.