engiGetAttrTypeByIndex
Syntax
public const string enginedll = @"engine.dll"; [DllImport(enginedll, EntryPoint = "engiGetAttrTypeByIndex")] public static extern void x86_engiGetAttrTypeByIndex(Int32 entity, Int32 index, out Int32 attributeType); [DllImport(enginedll, EntryPoint = "engiGetAttrTypeByIndex")] public static extern void x64_engiGetAttrTypeByIndex(Int64 entity, Int64 index, out Int64 attributeType); public static void engiGetAttrTypeByIndex(Int64 entity, Int64 index, out Int64 attributeType) { if (IntPtr.Size == 4) { x86_engiGetAttrTypeByIndex((Int32)entity, (Int32)index, out Int32 _attributeType); attributeType = _attributeType; } else { x64_engiGetAttrTypeByIndex(entity, index, out attributeType); } }
Property entity
Size: 32 bit / 4 byte (value)Property index
Size: 32 bit / 4 byte (value)Property attributeType
Size: 32 bit / 4 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call engiGetAttrTypeByIndex 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; }