hm_measureshortestdistance
Measures the shortest distance between two entity selections.
Syntax
hm_measureshortestdistance entity_type1 mark_id1 reserved1 entity_type2 mark_id2 reserved2 system_id
Type
HyperMesh Tcl Query Command
Description
This command measures the shortest distance between two entity selections. The return is a list of values:
d dx dy dz id1 x1 y1 z1 id2 x2 y2 z2
- d - The value of the shortest distance
- dx - The x value of the shortest distance, measured relative to the specified local system
- dy - The y value of the shortest distance, measured relative to the specified local system
- dz - The z value of the shortest distance, measured relative to the specified local system
- id1 - ID of the closest entity from mark 1
- x1 y1 z1 - Coordinates of the closest location on entity id1
- id2 - ID of the closest entity from mark 2
- x2 y2 z2 - Coordinates of the closest location on entity id2
Inputs
- entity_type1
- The type of entity on the first mark. Valid values are nodes, elements, points, lines, surfaces and solids.
- mark_id1
- The ID of the first mark. Valid values are 1 and 2.
- reserved1
- Reserved for future use. Must be set to 0.
- entity_type2
- The type of entity on the second mark. Valid values are nodes, elements, points, lines, surfaces and solids.
- mark_id2
- The ID of the second mark. Valid values are 1 and 2.
- reserved2
- Reserved for future use. Must be set to 0.
- system_id
- The ID of a local coordinate system to use for reporting the coordinate values dx, dy, dz, x1, y1, z1, x2, y2 and z2. If the value is specified as 0, the global coordinate system is used (default).
Examples
To get the shortest distance between nodes 100-200 and nodes 300-400:
*createmark nodes 1 100-200
*createmark nodes 2 300-400
hm_measureshortestdistance nodes 1 0 nodes 2 0 0
To get the shortest distance between surface 100 and lines 1-10, with the distance output relative to system ID 5:
*createmark surfs 1 100
*createmark lines 1 1-10
hm_measureshortestdistance surfs 1 0 lines 1 0 5
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.130
2020.1 - Added support for elements to entity_type1 and entity_type2.