GetInstancesByIterator
If input instance is zero, the handle will point to the first relevant instance.
If all instances are past (or no relevant instances are found), the function will return 0.
Syntax
// Visual Studio for Windows public: __int64 __declspec(dllexport) __stdcall GetInstancesByIterator( __int64 model, __int64 owlInstance ); // Linux, OS-X and non-Visual Studio Windows solutions public: int64_t GetInstancesByIterator( int64_t model, int64_t owlInstance );
Property model
Size: 64 bit / 8 byte (value)Property owlInstance
Size: 64 bit / 8 byte (value)
Example
Here you can find code snippits that show how the API call GetInstancesByIterator can be used.
int64_t GetInstanceCnt(int64_t model) { int64_t instanceCnt = 0, myIteratedInstance = GetInstancesByIterator(model, 0); while (myIteratedInstance) { char * instanceName = nullptr, * className = nullptr; GetNameOfInstance(myIteratedInstance, &instanceName); GetNameOfClass(GetInstanceClass(myIteratedInstance), &className); // // The name of the class can be checked by placing a breakpoint after this point while debugging // myIteratedInstance = GetInstancesByIterator(model, myIteratedInstance); instanceCnt++; } return instanceCnt; } int _tmain(int argc, _TCHAR* argv[]) { int64_t model = CreateModel(); if (model) { int64_t instanceCnt = GetInstanceCnt(model); // // Add a new class // CreateInstance(GetClassByName(model, "Collection"), "CreatedInstanceToTestInstanceCnt"); assert(GetInstanceCnt(model) == instanceCnt + 1); int64_t instanceCntThroughAPI = 0; OrderedHandles(model, nullptr, nullptr, &instanceCntThroughAPI, 0, 0); assert(GetInstanceCnt(model) == instanceCntThroughAPI); CloseModel(model); } return 0; }