sdaiCreateAggrBN

This call creates an aggregation. The instance has to be present, the attributeName argument can be NULL (0) in case the aggregation is an nested aggregation for this specific instance, preferred use would be use of sdaiCreateNestedAggr in such a case. Technically sdaiCreateAggrBN will transform into the following call

    (attributeName) ?
        sdaiCreateAggr(
                instance,
                sdaiGetAttrDefinition(
                        sdaiGetInstanceType(
                                instance
                            ),
                        attributeName
                    )
            ) :
        sdaiCreateAggr(
                instance,
                nullptr
            );

Syntax

//
//   Strong typing definition
//
SdaiAggr        sdaiCreateAggrBN(
                        SdaiInstance            instance,
                        const char              * attributeName
                    );

static  inline  SdaiAggr    sdaiCreateAggrBN(
                                    SdaiInstance            instance,
                                    char                    * attributeName
                                )
{
    return  sdaiCreateAggrBN(
                    instance,
                    (const char*) attributeName
                );
}


//
//   Weak typing definition
//
int_t   __declspec(dllexport) * __stdcall   sdaiCreateAggrBN(
                                                    int_t                   instance,
                                                    const char              * attributeName
                                                );

static  inline  int_t   * sdaiCreateAggrBN(
                                int_t                   instance,
                                char                    * attributeName
                            )
{
    return  sdaiCreateAggrBN(
                    instance,
                    (const char*) attributeName
                );
}
    

Property instance

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

Property attributeName

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

Example (based on pure API calls)

Here you can find code snippits that show how the API call sdaiCreateAggrBN 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");