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 IntPtr engiGetEntityArgumentName(int_t entity, int_t index, int_t valueType, out IntPtr argumentName);

public static string engiGetEntityArgumentName(int_t entity, int_t index)
        {
            IntPtr argumentName = IntPtr.Zero;
            engiGetEntityArgumentName(entity, index, sdaiSTRING, out argumentName);
            return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(argumentName);
        }    

Property entity

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

Property index

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

Property valueType

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

Property argumentName

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

Example (based on pure API calls)

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

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

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

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

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

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

                ...

                default:
                    break;
            }

            attributeCnt++;
        }

        return  attributeCnt;
    }

    return  0;
}