Purpose
Calculates the mathematical direction of a line object; corresponds to choosing Spatial > Edit > Calculate > Calculate Direction. This function requires the MapCAD Tool and can be executed via the Exec() command. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Exec ("MapCAD.mbx","CalcDirection", LineObj)
Return Value
Float. If the function failed the return value is 999.
Description
Use the CalcDirection function to calculate the mathematical direction angle of a line object in degrees. This angle is defined by the slope of the line, so the direction of the line is taken into account. A directional angle is determined counterclockwise with respect to the x-axis.
The MapCAD tool must be loaded. This function requires an active map window to determine the projection and units. To set the calculation accuracy, open the MapCAD settings dialog.Parameters | Description |
---|---|
LineObj | Object value, Line |
Examples
'Calculate the direction angle of a line.
Dim t as float
t = Exec("MapCAD.mbx","CalcDirection",LineObj)
note "Direction Angle = " + t