sdaiCreateModelBN

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       sdaiCreateModelBN(
                        SdaiRep                 repository,
                        const char              * fileName,
                        const char              * schemaName
                    );

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


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

static  inline  int_t   sdaiCreateModelBN(
                                int_t                   repository,
                                char                    * fileName,
                                char                    * schemaName
                            )
{
    return  sdaiCreateModelBN(
                    repository,
                    (const char*) fileName,
                    (const char*) schemaName
                );
}
    

Property repository

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

Property fileName

Size: 32 bit / 4 byte (reference)
The file name of the file as available in the file system in ASCII (char *). The given char array will not be adjusted, on each OS the size of a char element is 8 bit / 1 byte.

Property schemaName

Size: 32 bit / 4 byte (reference)
The schema name of the file as available in the file system in ASCII (char *). The given char array will not be adjusted, on each OS the size of a char element is 8 bit / 1 byte.

Example (based on pure API calls)

Here you can find code snippits that show how the API call sdaiCreateModelBN 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 = sdaiCreateModelBN(0, "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 = sdaiCreateModelBN(0, schemaName);

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

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

        sdaiCloseModel(model);
    }
}