engiGetAggrTypex

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "engiGetAggrTypex")]
public static extern void engiGetAggrTypex(int_t aggregate, out int_t aggregateType);    

Property aggregate

Size: 64 bit / 8 byte (reference)
...

Property aggregateType

Size: 64 bit / 8 byte (reference)
...

Example (based on pure API calls)

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

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

void WriteAttribute(Int64 ifcInstance, string attributeName, Int64 attributeType)
{
    switch  (attributeType) {
        case  IfcEngine.x64.sdaiAGGR:
            Int64 aggregate = 0;
            IfcEngine.x64.sdaiGetAttrBN(ifcInstance, System.Text.Encoding.UTF8.GetBytes(attributeName), IfcEngine.x64.sdaiAGGR, out aggregate);
            if (aggregate != 0)
            {
                Int64 cnt = IfcEngine.x64.sdaiGetMemberCount(aggregate);
                for (Int64 i = 0; i < cnt; i++)
                {
                    Int64 aggregateType = 0;
                    IfcEngine.x64.engiGetAggrType(aggregate, ref aggregateType);
                    switch (aggregateType) {
                        case  IfcEngine.x64.sdaiSTRING:
                            {
                                IntPtr valuePtr = IntPtr.Zero;
                                IfcEngine.x64.sdaiGetAggrByIndex(aggregate, i, IfcEngine.x64.sdaiUNICODE, out valuePtr);
                                string value = Marshal.PtrToStringUni(valuePtr);
                                ...
                            }
                            break;

                        ...

                        default:
                            break;
                    }
                }
            }
            break;

        ...

        default:
            break;
    }
}

void WriteAttributes(Int64 ifcInstance)
{
    Int64 ifcEntity = IfcEngine.x64.sdaiGetInstanceType(ifcInstance),
          attributeCnt = IfcEngine.x64.engiGetEntityNoArguments(ifcEntity);

    for (Int64 i = 0; i < attributeCnt; i++)
    {
        Int64 attributeType = 0;
        IntPtr attributeNamePtr = IntPtr.Zero;
        IfcEngine.x64.engiGetEntityArgumentName(ifcEntity, i, IfcEngine.x64.sdaiSTRING, out attributeNamePtr);
        IfcEngine.x64.engiGetEntityArgumentType(ifcEntity, i, ref attributeType);
        string attributeName = Marshal.PtrToStringAnsi(attributeNamePtr);
        WriteAttribute(ifcInstance, attributeName, attributeType);
    }
}