Model.hm_getactiveplotcontrolmaxvalue#

Model.hm_getactiveplotcontrolmaxvalue(plot_type, collection)#

Returns the maximum value for the active plot control together with the entity. There can be only one active plot control for every plot type.

Parameters:
  • plot_type (hwString) – The type of plot for which the result values are queried. Valid values are contour, vector, and tensor.

  • collection (Collection) – The collection containing the entities that are considered for evaluation.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • entity (Entity) - The entity for which the maximum value is returned.

    • value (float) - The maximum value for the active plot control.

Note

If the function is used as part of a script that creates the queried plot, it is required to call Model.hm_redraw before using this function to ensure the graphics are refreshed and the data can be extracted.

Example#

Get the maximum value for the active contour plot control for a collection of displayed nodes#
import hm
import hm.entities as ent

model = hm.Model()

nodes = hm.CollectionByDisplayed(model, ent.Node)
_, result = model.hm_getactiveplotcontrolmaxvalue(plot_type="contour", collection=nodes)

print("Entity ID:", result.entity.id)
print("Maximum Value:", result.value)