Hello
Further that the command "FindObjectAtPt_Create" works only for objects on the active layer it works also only correctly if the null point (document origin) of the drawing has not been changed. By moving the null point (document origin) of the drawing, the command "FindObjectAtPt_Create" does find not anymore objects.
I do not know if that represent a bug, but I guess so.
The above example script should then include an adjustment for the X, Y parameters of the "FindObjectAtPt_Create" command with the document origin:
PROCEDURE ObjectInRadius;
VAR
cnt, i : INTEGER;
startContainer : HANDLE;
list : LONGINT;
loc: VECTOR;
vX : REAL;
vY : REAL;
vXnew : REAL;
vYnew : REAL;
vXorg : REAL;
vYorg : REAL;
vObjectHandle : HANDLE;
vObjectName : STRING;
BEGIN
dselectall;
startContainer := NIL;
GetPt(vX,vY);
GetOrigin(vXorg, vYorg);
AlrtDialog(Concat('X/Y Org : ', vXorg, '/', vYorg));
vXnew := vXorg+vX;
vYnew := vYorg+vY;
AlrtDialog(Concat('X/Y; new : ', vX,'/', vY, ' ; ', vXnew,'/', vYnew));
list := FindObjAtPt_Create(startContainer, 0, 1, vXnew, vYnew, 0.5);
cnt := FindObjAtPt_GetCount(list)+1;
i := 0;
WHILE i < cnt DO BEGIN
vObjectHandle := FindObjAtPt_GetObj(list, i);
vObjectName := GetName(vObjectHandle);
SetSelect(vObjectHandle);
AlrtDialog(Concat('object : ', i , ' : ', vObjectName, ' : ', vObjectHandle));
i := i + 1;
END;
END;
Run(ObjectInRadius);