C++
int acedGetDist( const ads_point pt, const ACHAR * prompt, double * result );
File
acedads.h
Description
Gets user input for a linear distance.
The AutoCAD user can specify the distance by entering a number in the current units format. The user can set the distance also by specifying two 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 distance. If the pt argument is not null, AutoCAD uses this value as the first of the two points.
By default, acedGetDist() treats pt and result as three-dimensional points. A prior call to acedInitGet() can force pt to be two dimensional, ensuring that acedGetDist() returns result as a planar distance.
Regardless of the method used to specify the distance, or the current linear units (for example, feet and inches), acedGetDist() always sets result to a double-precision floating-point value.
The user cannot respond to acedGetDist() by entering an AutoLISP expression.
The acedGetDist() function returns one of the following: 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.
If pt or prompt is not used, pass a null pointer for these arguments.
Parameters
Parameters | Description |
---|---|
pt | Optional base point in the current UCS used by AutoCAD to display the point on the graphics screen |
prompt | Optional prompt string that acedGetDist() displays before it pauses |
result | Output distance selected by the user |
Returns
Pointer to the distance entered by the user, a memory area large enough to store a double-precision floating-point number.
Previous Declaration
AutoCAD 2024 and earlier
int acedGetDist (const ads_point pt, const ACHAR *prompt, ads_real *result);
History
AutoCAD 2025
result argument changed from ads_real to double.