Model.hm_getelemcheckbounds#

Model.hm_getelemcheckbounds(elements, dimension, check_type, time_failure=0.0005)#

Returns the lower bound and upper bound values of the specified element check from the selected elements. Only the elements on elements and of the specified dimension are considered when calculating the lower and upper bound values.

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

  • dimension (int) –

    The dimension of the elements on elements to consider. Valid values are:

    1 - 1D elements

    2 - 2D elements

    3 - 3D elements

    If no elements of the specified dimension are on elements, an error is returned.

  • check_type (hwString) –

    The type of element check to return the bounds from. The allowable values depend on the dimension specified:

    • dimension=1: length, timestep

    • dimension=2: addedmass, aspect, cellsquish, chordaldev, equiskew, jacobian, length, maxinterangle, maxlength, mininterangle, minlength, skew, taper, timestep, volumeareaskew, warpage

    • dimension=3: addedmass, altitudeaspect, aspect, cellsquish, equiskew, jacobian, length, maxinterangle, maxlength, mininterangle, minlength, ortho_3d, size_ratio_3d, skew, taper, tetracollapse, timestep, volumeareaskew, volumetricskew, warpage

  • time_failure (double) – The value to use as a threshold beyond which the input elements should be considered to have failed the test. This is required only when check_type="addedmass".

Returns:

Examples#

Get the min and max length of all displayed 1D bar2 elements in Optistruct profile#
import hm
import hm.entities as ent

model = hm.Model()

elem_collection_bar = hm.Collection(model, ent.Element, "config=60")
elem_collection_displayed = hm.CollectionByDisplayed(model, ent.Element)

model.markintersection(
    collectiona=elem_collection_bar, collectionb=elem_collection_displayed
)

_, result = model.hm_getelemcheckbounds(
    elements=elem_collection_bar, dimension=1, check_type="length"
)

print("lowerBound:", result.lowerBound)
print("upperBound:", result.upperBound)
Get the lower and upper length values for all first order 2D elements#
import hm
import hm.entities as ent

model = hm.Model()

elem_collection_2D = hm.Collection(model,ent.Element,"config=103 OR config=104")
elem_collection_displayed = hm.CollectionByDisplayed(model, ent.Element)

model.markintersection(
    collectiona=elem_collection_2D, collectionb=elem_collection_displayed
)

_, result = model.hm_getelemcheckbounds(
    elements=elem_collection_2D, dimension=2, check_type="length"
)

print("lowerBound:", result.lowerBound)
print("upperBound:", result.upperBound)