APIDb_​PointToCoordID

Convert a screen coordinate into model coordinate in the current database.

    GSErrCode ACAPI_Database (
        APIDb_PointToCoordID,
        API_Point*     point,
        API_Coord*     coord
    );

 

Parameters

point
[in] the pixel screen coordinate to convert
coord
[out] the associated model space coordinate

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
any of the parameters are nullptr

For other common API errors see the API Errors document.

 

Remarks

This function is used to determine the real (model space) coordinate of a screen pixel coordinate.

It is the inverse function of APIDb_CoordToPointID function. Note that different coordinates may be assigned to the same pixel. The conversion mainly depends on the window size, on the actual drawing scale and zoom settings (APIDb_GetDrawingScaleID, APIDb_GetZoomID) which means the projection is database dependent.

 

Example


API_Coord    c;
API_Point    p
GSErrCode    err;

c.x = 1.0;
c.y = 2.0;
err = ACAPI_Database (APIDb_CoordToPointID, &c, &p);
err = ACAPI_Database (APIDb_PointToCoordID, &p, &c);

 

Requirements

Version: API 4.1 or later
Header: APIdefs_Database.h

 

See Also

API_Point, API_Coord, APIDb_CoordToPointID,
ACAPI_Database, API Functions