Model.hm_getshelloverlapinfo#

Model.hm_getshelloverlapinfo(source_collection, target_collection, maxproximitydistance)#

Returns information regarding proximity overlap between a selection of components or elements.

Parameters:
  • source_collection (Collection) – The collection containing the source entities. Currently supported for components and elements.

  • target_collection (Collection) – The collection containing the target entities. Currently supported for components and elements.

  • maxproximitydistance (double) – Maximum proximity distance below which the overlap is calculated.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • proximityArea (double) - The proximity overlap area

    • proximityVolume (double) - The proximity overlap volume

    • maxProximityDistance (double) - The maximum proximity distance

    • minProximityDistance (double) - The minimum proximity distance

    • boundingBoxMinimumCoordinates (numpy.ndarray) - The minimum bounding box’s corner coordinates

    • boundingBoxMaximumCoordinates (numpy.ndarray) - The maximum bounding box’s corner coordinates

    • orientedBoxOrigin (numpy.ndarray) - The bounding box’s origin

    • orientedBoxXVector (numpy.ndarray) - The bounding box’s x-vector from origin

    • orientedBoxYVector (numpy.ndarray) - The bounding box’s y-vector from origin

    • orientedBoxZVector (numpy.ndarray) - The bounding box’s z-vector from origin

Example#

Get overlap information between component with ID 7100314 and component with ID 7100361 for a proximity distance of 5.0#
import hm
import hm.entities as ent

model = hm.Model()

comp_collection_1 = hm.Collection(model, ent.Component, [7100314])
comp_collection_2 = hm.Collection(model, ent.Component, [7100361])

_, result = model.hm_getshelloverlapinfo(
    source_collection=comp_collection_1,
    target_collection=comp_collection_2,
    maxproximitydistance=5.0,
)

print("The proximity overlap area:", result.proximityArea)
print("The proximity overlap volume:", result.proximityVolume)
print("The maximum proximity distance:", result.maxProximityDistance)
print("The minimum proximity distance:", result.minProximityDistance)
print(
    "The minimum bounding box's corner coordinates:",
    result.boundingBoxMinimumCoordinates,
)
print(
    "The maximum bounding box's corner coordinates:",
    result.boundingBoxMaximumCoordinates,
)
print("The bounding box's origin:", result.orientedBoxOrigin)
print("The bounding box's x-vector from origin ", result.orientedBoxXVector)
print("The bounding box's y-vector from origin:", result.orientedBoxYVector)
print("The proximity overlap area:", result.orientedBoxZVector)
print("The bounding box's z-vector from origin:", result.proximityArea)