Unable to change font size and style of legend (Ansys 2024R1)
Hi, Team
I can not change the font size and style of the legend in Ansys Mechanical.
Up to Ansys 2023R2, the code below worked fine, but starting with 2024R1, it prints ''DispCallable' object has no attribute 'SetFontStyle':line 7' as shown in the figure.
Is there any other way to approach this issue?
Font = "arial"
FontSize = 30
SpaceBetweenLetters = 0
Italic = 0
ds = ExtAPI.DataModel.InternalObject["ds"]
ds.Graphics.SetFontStyle(0, Font, 0, 0, FontSize, SpaceBetweenLetters, Italic)
ExtAPI.DataModel.Tree.Refresh()
Comments
-
Hi jwkim,
I was confronted to the same problem. It seems that the ds.graphics is now a method and it must be called with ds.graphics() like in the script below.
Font = "arial"
FontSize = 30
SpaceBetweenLetters = 0
Italic = 0
ds = ExtAPI.DataModel.InternalObject["ds"]
graphics = ds.graphics()
graphics.SetFontStyle(0, Font, 0, 0, FontSize, SpaceBetweenLetters, Italic)
ExtAPI.DataModel.Tree.Refresh()2