The GetNearestEntityWCS function determines a point that is nearest to the mouse cursor position.
Syntax:
int GetNearestEntityWCS(
HANDLE hObject,
LPCSTR NearestEntityName,
DWORD nSize,
LPRECT R,
LPPOINT APoint2D,
LPPOINT APoint3D,
);
Parameters:
hObject |
Identifies the CADImage object handle. |
NearestEntityName |
Contains the name of the closest entity after calling the GetNearestEntityWCS function. |
nSize |
Specifies size of the NearestEntityName buffer for a name of the closest entity. |
R |
Specifies the RECT structure that contains logical coordinates of the drawing rectangle. |
APoint2D |
Specifies a 2D point (in screen coordinates) relative to which search will be implemented. |
APoint3D |
Specifies a 3D point (in CAD drawing units) relative to which search will be implemented. |
Return Value:
If the function succeeds, the return value is 3.
If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.
Note:
After executing GetNearestEntityWCS function APoint3D contains the closest knot point of the entity returned in NearestEntityName.
See Also
© 2003-2024 CADSoftTools
Go to CAD DLL