sdaiCreateInstanceBN

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

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

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateInstanceBN")]
public static extern Int64 sdaiCreateInstanceBN(int_t model, string entityName);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateInstanceBN")]
public static extern Int64 sdaiCreateInstanceBN(int_t model, byte[] entityName);    

Property model

Size: 64 bit / 8 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: 64 bit / 8 byte (reference)
...

Example (based on pure API calls)

Here you can find code snippits that show how the API call sdaiCreateInstanceBN 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.x64.sdaiCreateInstanceBN(model, System.Text.Encoding.UTF8.GetBytes("IFCPOSTALADDRESS"));

Int64 addressLines = IfcEngine.x64.sdaiCreateAggrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("AddressLines"));
IfcEngine.x64.sdaiAppend(addressLines, IfcEngine.x64.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("RDF Ltd."));
IfcEngine.x64.sdaiAppend(addressLines, IfcEngine.x64.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Main Office"));

IfcEngine.x64.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("PostalBox"), IfcEngine.x64.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("32"));
IfcEngine.x64.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("Town"), IfcEngine.x64.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Bankya"));
IfcEngine.x64.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("Region"), IfcEngine.x64.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Sofia"));         //  It is allowed to mix sdaiUNICODE and sdaiSTRING
IfcEngine.x64.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("PostalCode"), IfcEngine.x64.sdaiUNICODE, System.Text.Encoding.Unicode.GetBytes("1320"));  //  as long as each call is consitent in itself.
IfcEngine.x64.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("Country"), IfcEngine.x64.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Bulgaria"));