I am interested in automating the view settings of my model in Mechanical. How can I do this with Scripting?
Here’s a short cheat sheet with useful commands for adjusting the Geometry panel view in Ansys Mechanical:
ExtAPI.Graphics.Camera.SetSpecificViewOrientation(arg)
ViewOrientationType.Front
ViewOrientationType.Back
ViewOrientationType.Left
ViewOrientationType.Right
ViewOrientationType.Top
ViewOrientationType.Bottom
ExtAPI.Graphics.Camera.SceneWidth = Quantity(arg)
'x [mm]'
ExtAPI.Graphics.Camera.SceneHeight = Quantity(arg)
ExtAPI.Graphics.Camera.Pan(Quantity(arg1), Quantity(arg2))
'x [mm]', 'y [mm]'
ExtAPI.Graphics.Camera.Zoom(arg)
x
ExtAPI.Graphics.Camera.SetFit()
-
ExtAPI.Graphics.Camera.Rotate(arg1,arg2)
angle
axis
ExtAPI.Graphics.Camera.FocalPoint = arg
Point([x, y, z], 'mm')
ExtAPI.Graphics.Camera.ViewVector = arg
Vector3D(x, y, z)
ExtAPI.Graphics.Camera.UpVector = arg
ExtAPI.Graphics.ViewOptions.ModelDisplay = arg
ModelDisplay.ShadedExteriorAndEdges
ModelDisplay.ShadedExterior
ModelDisplay.Wireframe
ExtAPI.Graphics.ViewOptions.ShowMesh = arg
True or False
ExtAPI.Graphics.ViewOptions.ResultPreference.DeformationScaleMultiplier = arg
X
ExtAPI.Graphics.ViewOptions.ResultPreference.DeformationScaling = arg
MechanicalEnums.Graphics.DeformationScaling.Auto
ExtAPI.Graphics.ViewOptions.ResultPreference.ContourView = arg
MechanicalEnums.Graphics.ContourView.SmoothContours
MechanicalEnums.Graphics.ContourView.ContourBands
MechanicalEnums.Graphics.ContourView.Isolines
MechanicalEnums.Graphics.ContourView.SolidFill
ExtAPI.Graphics.ViewOptions.ResultPreference.GeometryView = arg
MechanicalEnums.Graphics.GeometryView.Exterior
MechanicalEnums.Graphics.GeometryView.Isosurface
MechanicalEnums.Graphics.GeometryView.CappedIsosurface
ExtAPI.Graphics.ViewOptions.ResultPreference.ExtraModelDisplay = arg
MechanicalEnums.Graphics.ExtraModelDisplay.NoWireframe
MechanicalEnums.Graphics.ExtraModelDisplay.UndeformedWireframe
MechanicalEnums.Graphics.ExtraModelDisplay.UndeformedModel
MechanicalEnums.Graphics.ExtraModelDisplay.ShowElements
ExtAPI.Graphics.ViewOptions.ResultPreference.ShowMaximum = arg
ExtAPI.Graphics.ViewOptions.ResultPreference.ShowMinimum = arg