hm_measureshortestdistance2
Measures the shortest distance between a coordinate location and an entity selection.
Syntax
hm_measureshortestdistance2 x y z entity_type mark_id reserved system_id
Type
HyperMesh Tcl Query
Description
This command measures the shortest distance between a coordinate location and an entity selection. The return is a list of values:
d dx dy dz id x y z
- 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 the mark
- x1 y1 z1 – Coordinates of the closest location on entity id1
Inputs
- x
- The x input coordinate location.
- y
- The y input coordinate location.
- z
- The z input coordinate location.
- entity_type
- The type of entity on the mark. Valid values are nodes, points, lines, surfaces and solids.
- mark_id
- The ID of the mark. Valid values are 1 and 2.
- reserved
- Reserved for future use. Must be set to 0.
- system_id
- The ID of a local coordinate system to use for reporting the distance values dx, dy, dz, x1, y1 and z1. If the value is specified as 0, the global coordinate system is used (default).
Examples
To get the shortest distance between (0,10,0) and nodes 100-200:
*createmark nodes 1 100-200
hm_measureshortestdistance2 0 10 0 nodes 2 0 0
To get the shortest distance between (5,0,1) and lines 1-10, with the distance output relative to system ID 5:
*createmark lines 1 1-10
hm_measureshortestdistance2 5 0 1 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