engiGetEntityElement

This call returns a specific entity based on an index, the index needs to be 0 or higher but lower then the number of entities in the loaded schema.

Syntax

public const string ifcenginedll = @"ifcengine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "engiGetEntityElement")]
public static extern Int32 engiGetEntityElement(int_t model, int_t index);    

Property model

Size: 32 bit / 4 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 index

Size: 32 bit / 4 byte (value)
...

Example (based on pure API calls)

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

using RDF;      //  include at least engine.cs within your solution

void WriteEntities(Int64 model)
{
    Int64 i = 0, cnt = IfcEngine.x64.engiGetEntityCount(model);
    while  (i < cnt)
    {
        IntPtr entityNamePtr = IntPtr.Zero;
        Int64 ifcEntity = IfcEngine.x64.engiGetEntityElement(model, i);
        IfcEngine.x64.engiGetEntityName(ifcEntity, IfcEngine.x64.sdaiSTRING, out entityNamePtr);
        string entityName = Marshal.PtrToStringAnsi(entityNamePtr);
        Console.WriteLine("Entity  " + entityName);
    }
}