Ansys Learning Forum Forums Discuss Simulation General Mechanical Python Script to save Total deformation and Stress in a specific location (image Reply To: Python Script to save Total deformation and Stress in a specific location (image

pavankonchada123
Subscriber

I have used as this as scrt.py but images are not coming

 

'''NOTE : All workflows will not be recorded, as recording is under development.'''
solu=Model.Analyses[0].Solution
Graphics.Camera.FocalPoint = Point([0.000000, 0.050126, 0.000000], 'm')
Graphics.Camera.ViewVector = Vector3D(0.57735, 0.57735, 0.57735)
Graphics.Camera.UpVector = Vector3D(0, 1, 0)
Graphics.Camera.SceneHeight = Quantity(0.126253, 'm')
Graphics.Camera.SceneWidth = Quantity(0.046775, 'm')

image_settings = Ansys.Mechanical.Graphics.GraphicsImageExportSettings()
image_settings.CurrentGraphicsDisplay = False
image_settings.Resolution = GraphicsResolutionType.NormalResolution
image_settings.Capture = GraphicsCaptureType.ImageAndLegend
image_settings.Background = GraphicsBackgroundType.White
image_settings.FontMagnification = 1

totdef = solu.AddTotalDeformation()
totdef.EvaluateAllResults()

Graphics.ExportImage(r"""D:\Projects\TD.png""", GraphicsImageExportFormat.PNG, image_settings)
equstress = solu.AddEquivalentStress()
equstress.EvaluateAllResults()
Graphics.ExportImage(r"""D:\Projects\ES.png""", GraphicsImageExportFormat.PNG, image_settings)
#endregion

Â