VS:TrackObjectN

From Vectorworks Developer
Revision as of 23:05, 20 September 2014 by Orso.b.schmid (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

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)

Parameters

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.

Example

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 );

Version

Availability: from Vectorworks 2014

See Also

VS Functions:

VS:TrackObject | VS:GetPickObjectInfo

VS Functions:

[[VS:TrackObject]]

| [[VS:GetPickObjectInfo]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox