Calculate Points and Values

By using the methods provided by the Utility object, you can quickly solve a mathematical problem or locate points on your drawing. By using methods on the Utility object, you can do the following:

Find the distance between two points with the GetDistance method

This example uses the GetDistance method to obtain the point coordinates, and the MsgBox function to display the calculated distance.

Sub Ch3_GetDistanceBetweenTwoPoints()
	Dim returnDist As Double

	' Return the value entered by user. A prompt is provided.
	returnDist = ThisDrawing.Utility.GetDistance _
				 (, "Pick two points.")
	MsgBox "The distance between the two points is: " & returnDist
End Sub