engiGetEntityArgumentName

This call can be used to retrieve the name of the n-th argument of the given entity. Arguments of parent entities are included in the index. Both direct and inverse arguments are included.

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "engiGetEntityArgumentName")]
public static extern void engiGetEntityArgumentName(Int32 entity, Int32 index, Int32 valueType, out IntPtr argumentName);    

Property entity

Size: 32 bit / 4 byte (value)
Handle of an entity (schema item/class), for example IFCWALLSTANDARDCASE as defined in IFC4.exp.

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.

Property valueType

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

Property argumentName

Size: 32 bit / 4 byte (reference)
Name of the argument (schema attribute/property), for example Name of IFCROOT as defined in IFC4.exp.

Examples

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

Int32 WriteEntityStructure(Int32 ifcEntity)
{
    if (ifcEntity != 0)
    {
        //
        //  Iterate over the parents
        //
        Int32 attributeCnt = WriteEntityStructure(IfcEngine.x86.engiGetEntityParent(ifcEntity));

        //
        //  Print Entity name
        //
        IntPtr entityNamePtr = IntPtr.Zero;
        IfcEngine.x86.engiGetEntityName(ifcEntity, IfcEngine.x86.sdaiSTRING, out entityNamePtr);
        string entityName = Marshal.PtrToStringAnsi(entityNamePtr);
        Console.WriteLine("Entity  " + entityName);

        //
        //  Walk over attributes
        //
        while  (attributeCnt < IfcEngine.x86.engiGetEntityNoArguments(ifcEntity)) {
            IntPtr attributeNamePtr = IntPtr.Zero;
            Int32 attributeType = 0;
            IfcEngine.x86.engiGetEntityArgumentName(ifcEntity, attributeCnt, IfcEngine.x86.sdaiSTRING, out attributeNamePtr);
            IfcEngine.x86.engiGetEntityArgumentType(ifcEntity, attributeCnt, ref attributeType);
            string attributeName = Marshal.PtrToStringAnsi(attributeNamePtr);

            Console.Write("  " + attributeName + "  ");
            switch  (attributeType) {
                case  IfcEngine.x86.sdaiSTRING:
                    Console.WriteLine("STRING");
                    break;

                ...

                default:
                    break;
            }

            attributeCnt++;
        }

        return  attributeCnt;
    }

    return  0;
}