angtos

AutoCad AutoLISP Functions

 
angtos
 
 
 

Converts an angular value in radians into a string

(angtos angle [unit [precision]]) 

Arguments

angle

A real number, in radians.

unit

An integer that specifies the angular units. If unit is omitted, angtos uses the current value of the AutoCAD system variable AUNITS. The following units may be specified:

0 -- Degrees

1 -- Degrees/minutes/seconds

2 -- Grads

3 -- Radians

4 -- Surveyor's units

precision

An integer specifying the number of decimal places of precision to be returned. If omitted, angtos uses the current setting of the AutoCAD system variable AUPREC in the Command Reference.

The angtos function takes angle and returns it edited into a string according to the settings of unit, precision, the AutoCAD UNITMODE system variable, and the DIMZIN dimensioning variable in the Command Reference.

The angtos function accepts a negative angle argument, but always reduces it to a positive value between zero and 2 pi radians before performing the specified conversion.

The UNITMODE system variable affects the returned string when surveyor's units are selected (a unit value of 4). If UNITMODE = 0, spaces are included in the string (for example, “N 45d E”); if UNITMODE = 1, no spaces are included in the string (for example, “N45dE”).

Return Values

A string, if successful; otherwise nil.

Examples

Command: (angtos 0.785398 0 4)

"45.0000"

Command: (angtos -0.785398 0 4)

"315.0000"

Command: (angtos -0.785398 4)

"S 45d E"

NoteRoutines that use the angtos function to display arbitrary angles (those not relative to the value of ANGBASE) should check and consider the value of ANGBASE.
See Also