hm_getclosestnode

Returns the ID of the closest node to the point (x,y,z). Zero is returned if there are no nodes in the database.

Syntax

hm_getclosestnode x y z ?elem_mark? ?node_mark?

Type

HyperMesh Tcl Query Command

Description

Returns the ID of the closest node to the point (x,y,z). Zero is returned if there are no nodes in the database.

Inputs

x
The X coordinate of the input point.
y
The Y coordinate of the input point.
z
The Z coordinate of the input point.
?elem_mark?
If ?elem_mark? is given, only search nodes attached to elements (in components) on the mark. If ?elem_mark? is zero, it is ignored.
?node_mark?
If ?node_mark? is given, ignore nodes on this mark when searching.

Example

To find the closest node to (0,0,0) on a quad4 element:

hm_createmark elems 1 "by config" quad4
set id [hm_getclosestnode 0 0 0 1];

To find the closest node to (0,0,0) on all visible elements:

hm_createmark elems 1 advanced displayed
set id [hm_getclosestnode 0 0 0 1];

If ?elem_mark? is zero (or not given), all nodes (including temp nodes) will be searched. To ignore temp nodes that are not on your model, use:

hm_createmark elems 1 advanced all
set id [hm_getclosestnode 0 0 0 1];

Errors

None.