How can I adjust the view in the Geometry window in Mechanical using Scripting?
Options

Tasos
Member, Employee Posts: 22
✭✭✭✭
in Structures
I am interested in automating the view settings of my model in Mechanical. How can I do this with Scripting?
Tagged:
1
Best Answer
-
Here’s a short cheat sheet with useful commands for adjusting the Geometry panel view in Ansys Mechanical:
Command Arg Equivalent Action ExtAPI.Graphics.Camera.SetSpecificViewOrientation(arg)
ViewOrientationType.Front
View > Front ViewOrientationType.Back
View > Back ViewOrientationType.Left
View > Left ViewOrientationType.Right
View > Right ViewOrientationType.Top
View > Top ViewOrientationType.Bottom
View > Bottom ExtAPI.Graphics.Camera.SceneWidth = Quantity(arg)
'x [mm]'
Sets the view width to x mm ExtAPI.Graphics.Camera.SceneHeight = Quantity(arg)
'x [mm]'
Sets the view height to x mm ExtAPI.Graphics.Camera.Pan(Quantity(arg1), Quantity(arg2))
'x [mm]', 'y [mm]'
Shifts the camera position horizontally or vertically based on x and y quantities ExtAPI.Graphics.Camera.Zoom(arg)
x
Zooms in or out on the model by x amount ExtAPI.Graphics.Camera.SetFit()
-
Zooms to Fit ExtAPI.Graphics.Camera.Rotate(arg1,arg2)
angle
,axis
Rotates the camera about an axis ExtAPI.Graphics.Camera.FocalPoint = arg
Point([x, y, z], 'mm')
Set the focal point of the camera ExtAPI.Graphics.Camera.ViewVector = arg
Vector3D(x, y, z)
Set the vector pointing from the focal point to the camera ExtAPI.Graphics.Camera.UpVector = arg
Vector3D(x, y, z)
Set the vector pointing up from the focal point ExtAPI.Graphics.ViewOptions.ModelDisplay = arg
ModelDisplay.ShadedExteriorAndEdges
Display shaded exteriors and distinct edges ModelDisplay.ShadedExterior
Display shaded exteriors only ModelDisplay.Wireframe
Display as wireframe ExtAPI.Graphics.ViewOptions.ShowMesh = arg
True or False
Display or hide the model mesh ExtAPI.Graphics.ViewOptions.ResultPreference.DeformationScaleMultiplier = arg
X
Set result scale multiplier to x ExtAPI.Graphics.ViewOptions.ResultPreference.DeformationScaling = arg
MechanicalEnums.Graphics.DeformationScaling.Auto
Set result scale to Auto ExtAPI.Graphics.ViewOptions.ResultPreference.ContourView = arg
MechanicalEnums.Graphics.ContourView.SmoothContours
Gradual distinction of result contour colors MechanicalEnums.Graphics.ContourView.ContourBands
Distinct differentiation of result contour colors MechanicalEnums.Graphics.ContourView.Isolines
Line at transition between result legend values MechanicalEnums.Graphics.ContourView.SolidFill
Model only without contour markings ExtAPI.Graphics.ViewOptions.ResultPreference.GeometryView = arg
MechanicalEnums.Graphics.GeometryView.Exterior
Display exterior of selected geometry MechanicalEnums.Graphics.GeometryView.Isosurface
Display contour surfaces of equal value inside model MechanicalEnums.Graphics.GeometryView.CappedIsosurface
Contour results less/greater than a specified value ExtAPI.Graphics.ViewOptions.ResultPreference.ExtraModelDisplay = arg
MechanicalEnums.Graphics.ExtraModelDisplay.NoWireframe
Display deformed result only MechanicalEnums.Graphics.ExtraModelDisplay.UndeformedWireframe
Display with undeformed wireframe overlay MechanicalEnums.Graphics.ExtraModelDisplay.UndeformedModel
Display with translucent undeformed overlay MechanicalEnums.Graphics.ExtraModelDisplay.ShowElements
Display deformed result with mesh elements ExtAPI.Graphics.ViewOptions.ResultPreference.ShowMaximum = arg
True or False
Create probe annotation for maximum result ExtAPI.Graphics.ViewOptions.ResultPreference.ShowMinimum = arg
True or False
Create probe annotation for minimum result 1