sdaiCreateModelBNUnicode

This function creates and empty model (we expect with a schema file given).
Attributes repository and fileName will be ignored, they are their because of backward compatibility.
A handle to the model will be returned, or 0 in case something went wrong.

Syntax

//
//   Strong typing definition
//
SdaiModel       sdaiCreateModelBNUnicode(
                        SdaiRep                 repository,
                        const wchar_t           * fileName,
                        const wchar_t           * schemaName
                    );

static  inline  SdaiModel   sdaiCreateModelBNUnicode(
                                    SdaiRep                 repository,
                                    wchar_t                 * fileName,
                                    wchar_t                 * schemaName
                                )
{
    return  sdaiCreateModelBNUnicode(
                    repository,
                    (const wchar_t*) fileName,
                    (const wchar_t*) schemaName
                );
}


//
//   Weak typing definition
//
int_t   __declspec(dllexport) __stdcall sdaiCreateModelBNUnicode(
                                                int_t                   repository,
                                                const wchar_t           * fileName,
                                                const wchar_t           * schemaName
                                            );

static  inline  int_t   sdaiCreateModelBNUnicode(
                                int_t                   repository,
                                wchar_t                 * fileName,
                                wchar_t                 * schemaName
                            )
{
    return  sdaiCreateModelBNUnicode(
                    repository,
                    (const wchar_t*) fileName,
                    (const wchar_t*) schemaName
                );
}
    

Property repository

Size: 64 bit / 8 byte (value)
Ignore this attribute, the value will be ignored in the current implementation, present for backwards compatibility.

Property fileName

Size: 64 bit / 8 byte (reference)
The file name of the file as available in the file system in Unicode (wchar_t *). The given wchar_t array will not be adjusted. The size of each wchar_t element is depending on the OS, both 16 bit / 2 bytes wchar_t elements as well as 32 bit / 4 byte wchar_t elements are recognized and supported.

Property schemaName

Size: 64 bit / 8 byte (reference)
The file name of the file as available in the file system in Unicode (wchar_t *). The given wchar_t array will not be adjusted. The size of each wchar_t element is depending on the OS, both 16 bit / 2 bytes wchar_t elements as well as 32 bit / 4 byte wchar_t elements are recognized and supported.

Example (based on pure API calls)

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

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

void    OpenModel__optionI(
            )
{
    //
    //  It is possible to create a file based on an embedded schema.
    //  The following options are available for embedded schemas:
    //      IFC2X3 (version 2.3.0.1, i.e. IFC2x3 TC1 'ISO/PAS 16739:2005')
    //      IFC4   (version 4.0.2.1, i.e. IFC4 ADD2 TC1 'ISO 16739-1:2018')
    //      IFC4X1 (version 4.1.0.0, i.e. IFC4.1)
    //      IFC4X2 (version 4.2.0.0, i.e. IFC4.2)
    //      IFC4X3 (version 4.3.2.0, i.e. IFC4.3 ADD2)
    //      IFC4X4 (in development,  i.e. IFC4.4)
    //      AP203  (ISO 10303-203:2011 edition 2)    if STEP Engine code part is embedded in the compiled library
    //      AP214  (ISO 10303-214:2010 edition 3)    if STEP Engine code part is embedded in the compiled library
    //      AP242  (ISO 10303-242:2022 edition 3)    if STEP Engine code part is embedded in the compiled library
    //      CIS/2                                    if CIS/2 Engine code part is embedded in the compiled library
    //

    SdaiModel   model = sdaiCreateModelBNUnicode(0, L"IFC4");

    if (model) {
        SdaiInteger entityCount = engiGetEntityCount(model), instanceCount = 0;

        std::cout << "entity count (schema): " << entityCount << "\n";

        sdaiCloseModel(model);
    }
}

void    OpenModel__optionII(
                const char  * schemaName
            )
{
    //
    //  It is also possible to load a schema file (.exp)
    //  This schema can be one of the supported schemas, however it is
    //  also possible to use an adjusted or fully self developed schema
    // 
    //  Adjusted schemas will still support geometrical concepts (depending on the adjustments)
    //

    SdaiModel   model = sdaiCreateModelBNUnicode(0, schemaName);

    if (model) {
        SdaiInteger entityCount = engiGetEntityCount(model), instanceCount = 0;

        std::cout << "entity count (schema): " << entityCount << "\n";

        sdaiCloseModel(model);
    }
}