Model.hm_getboundingbox_predefined#

Model.hm_getboundingbox_predefined(collection, predefined_cut, limit)#

Returns the six values defining the bounding box for a collection of elements for a predefined box trim cut.

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

  • predefined_cut (hwString) – The name of a predefined cut. Valid values are front, rear, right, left, frontright, frontleft, rearright, rearleft.

  • limit (double) – The x value of the box for predefined cuts predefined_cut="front"/"rear"/"frontright"/"frontleft"/"rearright"/"rearleft".

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • minValues (numpy.ndarray)

    • maxValues (numpy.ndarray)

Example#

Get the bounding box for the displayed elements use a front cut with a limit of 0.1#
import hm
import hm.entities as ent

model = hm.Model()

element_collection = hm.CollectionByDisplayed(model, ent.Element)

_, result = model.hm_getboundingbox_predefined(
    collection=element_collection, predefined_cut="front", limit=0.1
)

print("Minimum coords:", result.minValues)
print("Maximum coords:", result.maxValues)