The Angle FromXAxis Method

Use the AngleFromXAxis method to measure the angle, in radians, between an imaginary line formed by two points and the WCS X-axis. This method returns a double. It has the following syntax:

dblAngle = UtilityObject.AngleFromXAxis(StartPoint, EndPoint) Table 7-15 explains this method's parameters.

Table 7-15. The AngleFromXAxis Method's Parameters

Name

Type

Description

StartPoint

Variant

A three-element array of doubles that specifies the first point of an imaginary line in WCS

EndPoint

Variant

A three-element array of doubles that specifies the second point of an imaginary line in WCS

This example gets two points from the user and then uses the AngleFromXAxis method to calculate the angle of a line formed by those points and the WCS X-axis:

Public Sub TestAngleFromXAxis() Dim varStart As Variant Dim varEnd As Variant Dim dblAngle As Double

With ThisDrawing.Utility varStart = .GetPoint(, vbCr & "Pick the start point: ") varEnd = .GetPoint(varStart, vbCr & "Pick the end point: ") dblAngle = .AngleFromXAxis(varStart, varEnd) .Prompt vbCr & "The angle from the X-axis is " _

& .AngleToString(dblAngle, acDegrees, 2) & " degrees" End With End Sub

Was this article helpful?

0 0

Post a comment