engiGetAggrElement

...

Syntax

public const string IFCEngineDLL = @"IFCEngine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "engiGetAggrElement")]
public static extern Int32 engiGetAggrElement(Int32 aggregate, Int32 elementIndex, Int32 valueType, out  Int32 value);

[DllImport(IFCEngineDLL, EntryPoint = "engiGetAggrElement")]
public static extern Int32 engiGetAggrElement(Int32 aggregate, Int32 elementIndex, Int32 valueType, out double value);

[DllImport(IFCEngineDLL, EntryPoint = "engiGetAggrElement")]
public static extern Int32 engiGetAggrElement(Int32 aggregate, Int32 elementIndex, Int32 valueType, out IntPtr value);    

Property aggregate

Size: 32 bit / 4 byte (value)
Handle of an aggregation (i.e. sorted collection).

Property elementIndex

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

Property valueType

Size: 32 bit / 4 byte (value)
Type of the value, for example sdaiSTRING, sdaiINSTANCE, sdaiREAL, ...

Property value

Size: 32 bit / 4 byte (reference)
Placeholder for the information, formatting depending on defined valueType.

Examples

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

void GetColumns(Int32 model)
{
    Int32 ifcColumnInstances = IfcEngine.x86.sdaiGetEntityExtentBN(model, System.Text.Encoding.UTF8.GetBytes("IFCCOLUMN")),
          noIfcColumnInstances = IfcEngine.x86.sdaiGetMemberCount(ifcColumnInstances);
    if (noIfcColumnInstances != 0)
    {
        for (Int32 i = 0; i < noIfcColumnInstances; i++)
        {
            Int32 ifcColumnInstance = 0;
            IfcEngine.x86.engiGetAggrElement(ifcColumnInstances, i, IfcEngine.x86.sdaiINSTANCE, out ifcColumnInstance);

            IntPtr globalIdPtr = IntPtr.Zero;
            IfcEngine.x86.sdaiGetAttrBN(ifcColumnInstance, System.Text.Encoding.UTF8.GetBytes("GlobalId"), IfcEngine.x86.sdaiUNICODE, out globalIdPtr);
            string globalId = Marshal.PtrToStringUni(globalIdPtr);

            IntPtr namePtr = IntPtr.Zero;
            IfcEngine.x86.sdaiGetAttrBN(ifcColumnInstance, System.Text.Encoding.UTF8.GetBytes("Name"), IfcEngine.x86.sdaiUNICODE, out namePtr);
            string name = Marshal.PtrToStringUni(namePtr);

            IntPtr descriptionPtr = IntPtr.Zero;
            IfcEngine.x86.sdaiGetAttrBN(ifcColumnInstance, System.Text.Encoding.UTF8.GetBytes("Description"), IfcEngine.x86.sdaiUNICODE, out descriptionPtr);
            string description = Marshal.PtrToStringUni(descriptionPtr);
        }
    }
}