sdaiCreateInstanceBN

This call creates an instance of the given entity. Technically it will transform into the following call

    sdaiCreateInstance(
            model,
            sdaiGetEntity(
                    model,
                    entityName
                )
        );

Syntax

//
//   Strong typing definition
//
SdaiInstance    sdaiCreateInstanceBN(
                        SdaiModel               model,
                        const char              * entityName
                    );

static  inline  SdaiInstance    sdaiCreateInstanceBN(
                                        SdaiModel               model,
                                        char                    * entityName
                                    )
{
    return  sdaiCreateInstanceBN(
                    model,
                    (const char*) entityName
                );
}


//
//   Weak typing definition
//
int_t   __declspec(dllexport) __stdcall sdaiCreateInstanceBN(
                                                int_t                   model,
                                                const char              * entityName
                                            );

static  inline  int_t   sdaiCreateInstanceBN(
                                int_t                   model,
                                char                    * entityName
                            )
{
    return  sdaiCreateInstanceBN(
                    model,
                    (const char*) entityName
                );
}
    

Property model

Size: 32 bit / 4 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property entityName

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

Example (based on pure API calls)

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

#include    "./include/ifcengine.h"
//
//  Created result when stored as IFC:
//  #31313 = IFCPOSTALADDRESS($, $, $, $, ('RDF Ltd.', 'Main Office'), '32', 'Bankya', 'Sofia', '1320', 'Bulgaria');
//
int_t   ifcPostalAddressInstance = sdaiCreateInstanceBN(model, "IFCPOSTALADDRESS");

int_t   * addressLines = sdaiCreateAggrBN(ifcPostalAddressInstance, "AddressLines");
sdaiAppend((int64_t) addressLines, sdaiSTRING, "RDF Ltd.");
sdaiAppend((int64_t) addressLines, sdaiSTRING, "Main Office");

sdaiPutAttrBN(ifcPostalAddressInstance, "PostalBox", sdaiSTRING, "32");
sdaiPutAttrBN(ifcPostalAddressInstance, "Town", sdaiSTRING, "Bankya");
sdaiPutAttrBN(ifcPostalAddressInstance, "Region", sdaiSTRING, "Sofia");         //  It is allowed to mix sdaiUNICODE and sdaiSTRING
sdaiPutAttrBN(ifcPostalAddressInstance, "PostalCode", sdaiUNICODE, L"1320");    //  as long as each call is consitent in itself.
sdaiPutAttrBN(ifcPostalAddressInstance, "Country", sdaiSTRING, "Bulgaria");