Get Distance 2D Function

Function to find distance on xy-plane between two nodes or user-defined points

This script uses the Pythagoras’ theorem to find the shortest distance between two nodes or user-defined points.

Functions:
GetDist2D – this function utilises the Pythagoras’ theorem using two points defined in a 2D space.

Two objects must be input into the function. Example: GetDist2D(obj_1, obj_2).

The function takes two types of inputs:
– Node objects.
– User defined objects with properties *.x and *.y.

GetDist2D returns a float value of the distance in the x-y plane.

In the example, the user is prompted to select two nodes in the model,  and the distance between the nodes in the x-y plane are subsequently displayed in the dialogue box.