engiGetEntityParent

Returns the direct parent entity, for example the parent of IfcObject is IfcObjectDefinition, of IfcObjectDefinition is IfcRoot and of IfcRoot is 0.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall engiGetEntityParent(
            __int64 entity
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t engiGetEntityParent(
            int64_t entity
        );    

Property entity

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

Examples

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

__int64 WriteEntityStructure(__int64 ifcEntity)
{
    if  (ifcEntity) {
        //
        //  Iterate over the parents
        //
        __int64	attributeCnt = WriteEntityStructure(engiGetEntityParent(ifcEntity));

        //
        //  Print Entity name
        //
        char    * entityName = 0;
        engiGetEntityName(ifcEntity, sdaiSTRING, &entityName);
        std::cout << "Entity  " << entityName << std::endl;

        //
        //  Walk over attributes
        //
        while  (attributeCnt < engiGetEntityNoArguments(ifcEntity)) {
            char    * attributeName = 0;
            __int64 attributeType = 0;
            engiGetEntityArgumentName(ifcEntity, attributeCnt, sdaiSTRING, &attributeName);
            engiGetEntityArgumentType(ifcEntity, attributeCnt, &attributeType);

            std::cout << "  " << attributeName << "  ";
            switch  (attributeType) {
                case  sdaiSTRING:
                    std::cout << "STRING";
                    break;

                ...

                default:
                    break;
            }
            std::cout << std::endl;

            attributeCnt++;
        }

        return  attributeCnt;
    }

    return  0;
}