engiGetAttrNameByIndex

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 explicit and inverse attributes are included. This call is deprecated, use SdaiAttr or attribute name as primary data and engiGetEntityAttributePosition.

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "engiGetAttrNameByIndex")]
public static extern IntPtr engiGetAttrNameByIndex(int_t entity, int_t index, int_t valueType, out IntPtr attributeName);    

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 attributeName

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

Example (based on pure API calls)

Here you can find code snippets that show how the API call engiGetAttrNameByIndex 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.engiGetEntityParent(ifcEntity));

        //
        //  Print Entity name
        //
        IntPtr entityName = ifcengine.engiGetEntityName(ifcEntity);
        Console.WriteLine("Entity  " + entityName);

        //
        //  Walk over attributes
        //
        while  (attributeCnt < ifcengine.engiGetEntityNoArguments(ifcEntity)) {
            string attributeName = ifcengine.engiGetEntityArgumentName(ifcEntity, attributeCnt);
            Int64 attributeType = 0;
            ifcengine.engiGetEntityArgumentType(ifcEntity, attributeCnt, out attributeType);

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

                ...

                default:
                    break;
            }

            attributeCnt++;
        }

        return  attributeCnt;
    }

    return  0;
}