Model.hm_getelementsqualityinfo#

Model.hm_getelementsqualityinfo(elements, criteria_use_mode=1, failedElements=s_defaultCollection)#

Computes quality parameters for the specified selection of elements.

Parameters:
  • elements (Collection) – The collection containing the input element entities.

  • criteria_use_mode (int) –

    0 - The default quality criteria adjusted to the selected averaged element size are automatically created if the criteria do not exist.

    1 - The quality criteria must be explicitly set beforehand. If the parameter is not given, 1 is used as the default value.

  • failedElements (Collection) – The output collection containing the failed element entities.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • totalNumberOfElements (int) - Total number of elements

    • numberOfFailedElements (int) - Number of failed elements

    • qualityIndex (double) - Quality index

    • percentageOfFailedElements (double) - % of failed elements

    • percentageOfTrias (double) - % of trias elements

Example#

Get for all elements in the current model , the quality information#
import hm
import hm.entities as ent

model = hm.Model()

element_collection = hm.Collection(model, ent.Element)
failed_elem_collection = hm.Collection(model, ent.Element, populate=False)

_, result = model.hm_getelementsqualityinfo(
    elements=element_collection, failedElements=failed_elem_collection
)

print("Total Number of Elements:", result.totalNumberOfElements)
print("Number of Failed Elements:", result.numberOfFailedElements)
print("Failed Elements IDs:", [e.id for e in failed_elem_collection])
print("Quality Index:", result.qualityIndex)
print("Percentage of Failed Elements:", result.percentageOfFailedElements)
print("Percentage of Trias:", result.percentageOfTrias)