hm_getboundingbox

Returns the bounding box of the specified entities.

Syntax

hm_getboundingbox entity_type mark_id entity_flag system_id box_type

Type

HyperMesh Tcl Query Command

Description

This command returns the dimensional properties of a bounding box from the specified entities and options.

For box_type set to 0, the returned values are:

x_min y_min z_min x_max y_max z_max

For box_type set to 1, the returned values are:

x_min y_min z_min x_max y_max z_max localx_x localx_y localx_z localy_x localy_y localy_z localz_x localz_y localz_z dim1 dim2 dim3

Inputs

entity_type
The type of entity to find the bounding box for. See the list of supported entities for this command.
mark_id
The ID of the mark containing the entities. Valid values are 1 and 2.
entity_flag
This is a bit value used when entity_type is assems or comps.
For assems, this specifies whether to consider nodes/elems, geometry, and/or connectors.
For comps, this specifies whether to consider nodes/elems, geometry and/or connectors.
It is ignored for all other entity_types and should be set to 0, but there is no error if bit values are specified that do not correspond to the current entity_type.
The bit values are summed as (Bit0 + 2*Bit1 + 4*Bit2).
Bit0:0 - Do not consider nodes/elems.
  • 1 - Consider nodes/elems.
Bit1:0 - Do not consider geometry.
  • 1 - Consider geometry.
Bit2:0 - Do not consider connectors
  • 1 - Consider connectors.
system_id
The ID of the local coordinate system to return the values relative to. A value of 0 is the global system. Currently only rectangular systems are supported. Ignored if box_type is set to 1.
box_type
The type of bounding box to return.

0 - The bounding box is calculated in the global coordinate system, and the minimum and maximum coordinates are returned.

1 - The bounding box is calculated according to the part orientation, and the minimum and maximum coordinates, local axes, and dimensions of the box are returned.

Examples

To get the bounding box for the displayed elements oriented relative to the global system:
*createmark elems 1 displayed
hm_getboundingbox elems 1 0 0 0
To get the bounding box for the geometry in comps 1-4 oriented relative to rectangular system 100:
*createmark comps 1 1-4
hm_getboundingbox elems 1 2 100 0
To get the bounding box for the geometry in component 5 in the part orientation:
*createmark comps 1 5
hm_getboundingbox comps 1 2 0 1

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

11.0

2023.1 - Added new box_type value 1.

2026 - Added new dimension values to the command output for box_type set to 1.