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(Int32 model, Int32 index);    

Property model

Size: 32 bit / 4 byte (value)
Handle of the model containing the IFC file, this handle is needed in many other calls and given when the model is created.

Property index

Size: 32 bit / 4 byte (value)
Integer value equal or larger then 0 and smaller than given maximum length of array/list/aggregation used.

Examples

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

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