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

public const string EngineDLL = @"engine.dll";[DllImport(EngineDLL, EntryPoint = "GetPropertiesByIterator")]
public static extern Int64 GetPropertiesByIterator(Int64 model, Int64 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.

using Engine;

public Int64 GetPropertyCnt(Int64 model)
{
    Int64   propertyCnt = 0,
            myIteratedProperty = Engine.x86_64.GetPropertiesByIterator(model, 0);
    while (myIteratedProperty != 0)
    {
        IntPtr    propertyNamePtr = IntPtr.Zero;
        Engine.x86_64.GetNameOfProperty(myIteratedProperty, out propertyNamePtr);
        string propertyName = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(propertyNamePtr);
        Console.WriteLine(propertyName);
        myIteratedProperty = Engine.x86_64.GetPropertiesByIterator(model, myIteratedProperty);
        propertyCnt++;
    }
    Console.WriteLine();

    return  propertyCnt;
}

public void Example()
{
    Int64 model = Engine.x86_64.CreateModel();

    if (model != 0)
    {
        Int64   propertyCnt = GetPropertyCnt(model);

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

        System.Diagnostics.Debug.Assert(GetPropertyCnt(model) == propertyCnt + 1);

        Int64   propertyCntThroughAPI = 0;
        Engine.x86_64.OrderedHandles(model, (IntPtr) null, out propertyCntThroughAPI, (IntPtr) null, 0, 0);

        System.Diagnostics.Debug.Assert(GetPropertyCnt(model) == propertyCntThroughAPI);

        Engine.x86_64.CloseModel(model);
    }
}