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

public const string ifcenginedll = @"ifcengine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateAggrBN")]
public static extern Int64 sdaiCreateAggrBN(int_t instance, string attributeName);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateAggrBN")]
public static extern Int64 sdaiCreateAggrBN(int_t instance, byte[] attributeName);    

Property instance

Size: 64 bit / 8 byte (value)
...

Property attributeName

Size: 64 bit / 8 byte (reference)
...

Example (based on pure API calls)

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

using RDF;      //  include at least engine.cs within your solution

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

Int64 addressLines = ifcengine.sdaiCreateAggrBN(ifcPostalAddressInstance, "AddressLines");
ifcengine.sdaiAppend(addressLines, ifcengine.sdaiSTRING, "RDF Ltd.");
ifcengine.sdaiAppend(addressLines, ifcengine.sdaiSTRING, "Main Office");

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