kdist#
- Keypoints.kdist(kp1='', kp2='', **kwargs)#
Calculates and lists the distance between two keypoints.
Mechanical APDL Command: KDIST
- Parameters:
- Returns:
list[DIST, X, Y, Z]distancebetweentwokeypoints.
Notes
kdist lists the distance between keypoints
KP1andKP2, as well as the current coordinate system offsets fromKP1toKP2, where the X, Y, and Z locations ofKP1are subtracted from the X, Y, and Z locations ofKP2(respectively) to determine the offsets. kdist is valid in any coordinate system except toroidal ( csys,3).kdist returns a variable, called
_RETURN, which contains the distance value. You can use this value for various purposes; for example, to set the default number of line divisions to be generated along region boundary lines ( esize,_RETURN). In interactive mode, you can access this command by using the Model Query Picker ( Utility Menu> List> Picked Entities ), where you can also access automatic annotation functions, and display the value on your model.This command is valid in any processor.
Examples
Compute the distance between two keypoints.
>>> kp0 = (0, 10, -3) >>> kp1 = (1, 5, 10) >>> knum0 = mapdl.k("", *kp0) >>> knum1 = mapdl.k("", *kp1) >>> dist = mapdl.kdist(knum0, knum1) >>> dist [13.96424004376894, 1.0, -5.0, 13.0]