GetPropertiesByIterator

Returns a handle to a property.
If input property is zero, the handle will point to the first relevant property.
If all properties are past (or no relevant properties are found), the function will return 0.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall GetPropertiesByIterator(
            __int64             model,
            __int64             rdfProperty
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t GetPropertiesByIterator(
            int64_t             model,
            int64_t             rdfProperty
        );    

Property model

Size: 64 bit / 8 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property rdfProperty

Size: 64 bit / 8 byte (value)
This attribute represents a handle to the property, this can be either a datatype property (attribute), an object property (relation) or non-defined property. The handle will be static during the life-time of the model, when the model (or part of it) is saved and opened again, the handle will most probably be different.

Example

Here you can find code snippits that show how the API call GetPropertiesByIterator can be used.

int64_t GetPropertyCnt(int64_t model)
{
    int64_t propertyCnt = 0,
            myIteratedProperty = GetPropertiesByIterator(model, 0);
    while (myIteratedProperty) {
        char    * propertyName = nullptr;
        GetNameOfProperty(myIteratedProperty, &propertyName);
        //
        //  The name of the property can be checked by placing a breakpoint after this point while debugging
        //
        myIteratedProperty = GetPropertiesByIterator(model, myIteratedProperty);
        propertyCnt++;
    }

    return  propertyCnt;
}

int _tmain(int argc, _TCHAR* argv[])
{
    int64_t model = CreateModel();

    if (model) {
        int64_t propertyCnt = GetPropertyCnt(model);

        //
        //  Add a new property
        //
        CreateProperty(model, 0, "CreatedPropertyToTestPropertyCnt");

        assert(GetPropertyCnt(model) == propertyCnt + 1);

        int64_t propertyCntThroughAPI = 0;
        OrderedHandles(model, nullptr, &propertyCntThroughAPI, nullptr, 0, 0);

        assert(GetPropertyCnt(model) == propertyCntThroughAPI);

        CloseModel(model);
    }

    return  0;
}