C++
ACCORE_PORT int acdbAngToF( const ACHAR * str, int unit, double * v );
File
acedads.h
Description
Converts a string representation of an angle to a double-precision floating-point value.
The unit value should correspond to a valid value for the AutoCAD system variable AUNITS, as shown in following table:
Mode value | String format |
---|---|
0 | Degrees |
1 | Degrees/minutes/seconds |
2 | Grads |
3 | Radians |
4 | Surveyor's units |
The string str must be a string that acdbAngToF() can parse correctly according to the mode specified by unit. It can be in the "canonical" form that acdbAngToS() returns, or in a form that AutoCAD allows for keyboard entry. The acdbAngToF() and acdbAngToS() functions are complementary; if you pass acdbAngToF() a string created by acdbAngToS(), then acdbAngToF() is guaranteed to return a valid value in v, and the converse also applies provided that the unit argument specifies the same mode in both calls.
Parameters
Parameters | Description |
---|---|
str | String representation of the angle being converted |
unit | Units in which the string is formatted; if -1, uses the current value of AUNITS |
v | Result of the conversion, in radians |
Returns
On success returns RTNORM, otherwise returns an error code.
Previous Declaration
AutoCAD 2025
int acdbAngToF(const ACHAR *str, int unit, double *v);
AutoCAD 2024 and Earlier
int acdbAngToF(const ACHAR *str, int unit, ads_real *v);
History
AutoCAD 2025
v argument changed from ads_real to double.