VCOM:VectorWorks:ISDK::ForEachObject

From Vectorworks Developer
Jump to: navigation, search

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks

Member of VCOM:VectorWorks:ISDK


Calls action function (GS_ForEachObjectProcPtr) with env equal to actionEnv and h equal in turn to each object that matches the criteria specified by traverseWhat.

typedef void (*GS_ForEachObjectProcPtr)(Handle h, CallBackPtr cbp, void *env);
virtual void ForEachObject(
short traverseWhat,
GS_ForEachObjectProcPtr action,
void *actionEnv)

Parameters

short traverseWhat Selector for traversing. See 'Remarks' secion.
GS_ForEachObjectProcPtr action Callback function while traversing.
void* actionEnv Data passed to the callback function while traversing.

Remarks

The 'traverseWhat' parameter can be combination (bitwise or) of the following values:
enum {
	allSelected		= 0,  // all visible, selected objects;
	allEditable		= 1,  // all visible, unlocked objects on currently editable layers;
	allVisible		= 2,  // all selected and unlocked objects;
	allDrawing		= 3,  // all objects in the drawing on all layers, regardless of visibility, selection, or locked state;
	allSymbolDefs		= 4,  // all symbol definitions;
	allSelectedAndEditable	= 5,
	allObjects		= 6,  // all objects in the drawing and all symbol definitions
	
	descendIntoGroups 	= 32, // also process objects inside of qualifying groups;
	descendIntoAll 		= 64,
	descendIntoViewports 	= 128 // also process objects inside of qualifying groups and group-like objects (walls, sweeps, extrudes, etc.)
};

For traversing symbols in the drawing only "allDrawing" and "allObjects" will work. (SDK2013)

Example

struct SMyData
{
   ...
};

void MyCallBack(Handle h, CallBackPtr cbp, void *env)
{
   SMyData* pEnv = (SMyData*) env;

   ...
}

void TraverseFunction()
{
   SMyData data;

   // will search only the layers
   gSDK->ForEachObject( allObjects, MyCallBack, & data );

   // will search inside groups
   gSDK->ForEachObject( allObjects | descendIntoAll, MyCallBack, & data );
}

Version

Availability: from Vectorworks 2009
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox