Interactively, including highlighting, allows the user to select one object meeting the specified criteria.
The callback function is used to let the user filter the object that can be returned from the function. Any of these below, depending on what info is needed :
- FUNCTION Callback(h : HANDLE): BOOLEAN;
- FUNCTION CheckObjCallback(h : HANDLE; px, py : REAL) : BOOLEAN;
- FUNCTION CheckObjCallback(h : HANDLE; px, py, pz : REAL) : BOOLEAN;
The parameters ''px, py, pz'' pass into the function information about current cursor position in document units. This callback function is called when tracking over an object; also when click happens over an object.
PROCEDURE TrackObjectN(
traverseType : INTEGER;
callback : PROCEDURE;
VAR outObj : HANDLE;
VAR p : REAL);def vs.TrackObjectN(traverseType, callback):
return (outObj, p)| Name | Type | Description |
|---|---|---|
| traverseType | INTEGER | Specify how to traverse the drawing. |
| callback | PROCEDURE | The callback that will be called to check if an object meets the requrements to be tracked. See remarks. |
| outObj | HANDLE | Returns handle of the object for which the callback returned TRUE. |
| p | REAL | Returns coordinates of mouse click. |
_c_ (2021.01.22) Traverse Options:
- 0 = Shallow
- 1 = Groups (Traverse inside groups)
- 2 = Deep (Traverse all containers: walls, extrudes, sweeps, etc)
PROCEDURE Test;
VAR
h : HANDLE;
x, y, z : REAL;
FUNCTION CheckObjCallback(h : HANDLE) : BOOLEAN;
{or FUNCTION CheckObjCallback(h : HANDLE; px, py : REAL) : BOOLEAN;}
{or FUNCTION CheckObjCallback(h : HANDLE; px, py, pz : REAL) : BOOLEAN;}
BEGIN
{any object is ok}
CheckObjCallback := true;
END;
BEGIN
TrackObjectN( 0, CheckObjCallback, h, x, y, z );
SetSelect( h );
END;
RUN( Test );VS Functions: TrackObject | GetPickObjectInfo
Availability: from Vectorworks 2014