VCOM:VectorWorks:ISDK::ForEachObject: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (I thing that "+" sign was wrong.) |
||
Line 88: | Line 88: | ||
// will search inside groups | // will search inside groups | ||
gSDK->ForEachObject( allObjects | gSDK->ForEachObject( allObjects | descendIntoAll, MyCallBack, & data ); | ||
} | } | ||
</code> | </code> |
Revision as of 13:58, 16 January 2014
.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.) };
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