How to change the Min and Max values of a result contour Legend in Mechanical?

Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 249
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭

How to change the Min and Max values of a result contour Legend in Mechanical as highlighted below?

Comments

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 249
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    One can use Mechanical scripting to modify the legend min and max values as shown below (example for Stress plot. Unit needs to be modified according to the result type used).

    legendSettings = Ansys.Mechanical.Graphics.Tools.LegendSettings("MPa")
    legendSettings.SetMinMax(Quantity(0,'MPa'),Quantity(0.6,'MPa'))
    legendSettings.CopyTo(Ansys.Mechanical.Graphics.Tools.CurrentLegendSettings())
    

    Modified legend: