-
-
June 16, 2020 at 2:03 pm
AntoineRo
SubscriberHi there !
I was wondering if there was an easy way to plot the maximal absolute principal stress on ANSYS Workbench.Â
The following "User-defined Result" allows to do so but I would like to keep the negative signs for compression and the positive signs for tension.Â
Is there a way without using APDL since I have never used it please ?
I guess it should look something like this :
IF(abs(S1)>abs(S3) ; S1 ; S3)
But there seems to be a syntax error.Â
Â
Thanks a lot !
Regards,
AntoineÂ
-
June 17, 2020 at 3:47 pm
Sai Deogekar
Ansys EmployeeHi!
The IF statement cannot be used in User-Defined Results. You may go through the following Documentation:
https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v201/en/wb_sim/ds_user_defined_express.html
Â
One was to get around it would be to use APDL commands in Mechanical. To do this, right-click on Solution-->Insert-->Commands. In the Commands window, paste the following:
/graphics,power
Â
set,1,last          !Choose the last substep in step 1
Â
!Define the RGB colors
/RGB,INDEX,100,100,100,0
/RGB,INDEX,80,80,80,13
/RGB,INDEX,60,60,60,14
/RGB,INDEX,0,0,0,15
/TRIAD,off
Â
*IF,S1,ABGT,S3,THENÂ Â Â Â Â Â Â !Similar to IF(abs(S1)>abs(S3))
/SHOW,PNGÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ! This will save a png file in projectname_files/dp0/SYS/MECH
/view,1,1,1,1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ! Set the view angle
ESEL,all
PLNSOL,S,1
*ELSE
/SHOW,PNG
/view,1,1,1,1
ESEL, all
PLESOL,S,3
Â
Hope this helps,
Sai
-
June 18, 2020 at 1:27 pm
AntoineRo
SubscriberHello Sai,
Thanks a lot for your quick answer !
Your solution seems to work even though I am wondering if the "if" condition applies to each element or to the total assembly.Â
Unfortunatly for this project, I don't have much time to look into the APDLÂ coding to find the correct view I need.Â
I will stick to using 2 different plots on Mechanical for now.Â
Thanks again for your time and answer,Â
Regards,Â
AntoineÂ
Â
-
November 2, 2023 at 12:16 pm
Philipp Holzmann
Subscriber -
November 2, 2023 at 12:37 pm
ErKo
Ansys EmployeeÂ
Hi
Thank you.
As this post is very old, we are closing it (perhaps users will find the solution useful).
Â
Â
-
- The topic ‘Plot maximum and minimum principal stress ANSYS Workbench’ is closed to new replies.
-
5864
-
1906
-
1420
-
1305
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.
