Class: CurrentLegendSettings
Represents a CurrentLegendSettings object. This object holds properties of the CurrentLegendSettings.
Examples
The following command prints legend statistics for all results in the tree
legend = Ansys.Mechanical.Graphics.Tools.CurrentLegendSettings()
for res in ExtAPI.DataModel.GetObjectsByType(DataModelObjectCategory.Result):
ExtAPI.DataModel.Tree.Activate([res])
low_bound = legend.GetLowerBound(0)
high_bound = legend.GetUpperBound(legend.NumberOfBands-1)
print('{} has {} legend bands ranging from {} to {}'.format(res.Name, legend.NumberOfBands, low_bound, high_bound))
The following command prints legend statistics for the active object in 2 viewports
def dump_legend_stats_for_viewport(viewport_idx):
Graphics.ModelViewManager.SetActiveViewPort(viewport_idx)
obj = ExtAPI.DataModel.Tree.FirstActiveObject
viewport_legend = Ansys.Mechanical.Graphics.Tools.CurrentLegendSettings()
low_bound = viewport_legend.GetLowerBound(0)
high_bound = viewport_legend.GetUpperBound(viewport_legend.NumberOfBands-1)
print('{} has {} legend bands ranging from {} to {}'.format(obj.Name, viewport_legend.NumberOfBands, low_bound, high_bound))
dump_legend_stats_for_viewport(0)
dump_legend_stats_for_viewport(1)
Properties
Name |
Description |
AllScientificNotation
|
Whether the result values are displayed in scientific notation.
|
ColorScheme
|
Color Scheme for the legend.
|
Digits
|
Number of significant digits(min:2, max:8).
|
HighFidelity
|
Whether to replot and improve the synchronization of the result values.
|
LogarithmicScale
|
Whether the result values are distributed in a Logarithmic scale.
|
NumberOfBands
|
Number of bands on the legend (min:3, max:30). Bands are added/removed from the top of the legend.
|
SemiTransparency
|
Whether the legend is semi-transparent.
|