C++
int acedGetAngle( const ads_point pt, const ACHAR * prompt, double * result );
File
acedads.h
Description
Gets user input for an angle, taking into account the current value of the ANGBASE system variable.
The AutoCAD user can specify the angle by entering a number in the current angular units format. The user can set the angle also by specifying two 2D locations on the graphics screen. AutoCAD draws a rubber-band line from the first point to the current crosshair position to help the user visualize the angle. If the pt argument is not null, AutoCAD uses this value as the first of the two points. The angle is measured in the XY plane of the current UCS (acedGetAngle() ignores the Z field of pt).
The direction of angular increase is always counterclockwise.
The acedGetAngle() function is almost identical to acedGetOrient(), but it takes into account the current value of the ANGBASE system variable. For acedGetOrient(), the 0 angle is always to the right: "east" or "3 o'clock." For acedGetAngle(), the 0 angle is the value of ANGBASE, which can be set to any of the four 90-degree quadrants. Both acedGetAngle() and acedGetOrient() return a (real) angle value in radians measured counterclockwise from a base (0) angle. For acedGetAngle(), the base equals ANGBASE; for acedGetOrient(), the base is at the right. Both functions honor the current value of ANGDIR, which affects the value the user enters but not the value that these functions return.
For example, if ANGBASE is set to 90 degrees (north) and ANGDIR is set to 1 (clockwise direction for increasing angles), as shown in the figure that accompanies the following table, then given these conditions, the values returned by acedGetAngle() and acedGetOrient() will be as shown in the table.
Results from acedGetAngle and acedGetOrient:
User input (degrees) | acedGetAngle() returns | acedGetOrient() returns |
---|---|---|
0 | 0.0 | 1.5708 |
-90 | 1.5708 | 3.14159 |
180 | 3.14159 | 4.71239 |
90 | 4.71239 | 0.0 |
The user cannot respond to acedGetAngle() by entering an AutoLISP expression.
You can use acedGetAngle() to obtain a rotation amount for a block insertion, because an input of 0 degrees always returns 0 radians. You can use acedGetOrient() to obtain the baseline angle for a text entity to be aligned with other objects.
The acedGetAngle() function returns RTNORM if it succeeds, RTERROR if it fails, or RTCAN if the user cancels the request (by pressing [Esc] ). It returns RTMODELESS, if the active command was registered using the ACRX_CMD_INTERRUPTIBLE flag and the document has received a modeless interrupt signal from a call to AcApDocManager::sendModelessInterrupt(). A prior call to acedInitGet() can also enable return values of RTNONE or RTKWORD (see the description of acedInitGet()).
If the optional pt or prompt is not used, pass a null pointer for these arguments.
Parameters
Parameters | Description |
---|---|
pt | Optional angle base point in the current (two-dimensional) UCS used by AutoCAD to display the point on the graphics screen |
prompt | Optional prompt string that acedGetAngle() displays before it pauses |
result | Output angle selected by the user in radians |
Previous Declaration
AutoCAD 2024 and earlier
int acedGetAngle (const ads_point pt, const ACHAR *prompt, ads_real *result);
History
AutoCAD 2025
result argument changed from ads_real to double.