engiGetEntityModel

This call retrieves a model based on a given entity handle.

Syntax

//
//   Strong typing definition
//
SdaiModel       engiGetEntityModel(
                        SdaiEntity              entity
                    );


//
//   Weak typing definition
//
int_t   __declspec(dllexport) __stdcall   engiGetEntityModel(
                                                                        int_t                   entity
                                                                    );
    

Property entity

Size: 32 bit / 4 byte (value)
...

Example (based on pure API calls)

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

#include    "./include/ifcengine.h"
#include    <assert.h>

void    WalkInstances(SdaiModel model, SdaiEntity entity)
{
    char    * entityName = nullptr;
    engiGetEntityName(entity, sdaiSTRING, &entityName);
    std::cout << "Entity: " << entityName << "\n";

    SdaiAggr entityAggr = sdaiGetEntityExtent(model, entity);
    SdaiInteger instanceCnt = sdaiGetMemberCount(entityAggr);
    for (SdaiInteger index = 0; index < instanceCnt; index++) {
        SdaiInstance    ifcInstance = 0;
        sdaiGetAggrByIndex(entityAggr, index, sdaiINSTANCE, &ifcInstance);

        if (index) std::cout << ", ";
        std::cout << internalGetP21Line(ifcInstance);
    }

    std::cout << "\n";

    assert(engiGetEntityModel(entity) == model);
}

void    WalkEntities(SdaiModel model)
{
    SdaiInteger entityCount = engiGetEntityCount(model);
    for (SdaiInteger index = 0; index < entityCount; index++) {
        SdaiEntity  entity = engiGetEntityElement(model, index);
        WalkInstances(model, entity);
    }
}