engiSaveSchemaBNUnicode

This function saves the schema (wchar, i.e. Unicode file name). If save operation finished succesfully the return value will be 0, in case of non-zero value: 1 - model is NULL or not recognized as a model handle 2 - file at path location cannot be created/overwritten

Syntax

//
//   Strong typing definition
//
int_t                       engiSaveSchemaBNUnicode(
                                    SdaiModel               model,
                                    const wchar_t           * filePath
                                );

static  inline  int_t   engiSaveSchemaBNUnicode(
                                SdaiModel               model,
                                wchar_t                 * filePath
                            )
{
    return  engiSaveSchemaBNUnicode(
                    model,
                    (const wchar_t*) filePath
                );
}


//
//   Weak typing definition
//
int_t   __declspec(dllexport) __stdcall engiSaveSchemaBNUnicode(
                                                int_t                   model,
                                                const wchar_t           * filePath
                                            );

static  inline  int_t   engiSaveSchemaBNUnicode(
                                int_t                   model,
                                wchar_t                 * filePath
                            )
{
    return  engiSaveSchemaBNUnicode(
                    model,
                    (const wchar_t*) filePath
                );
}
    

Property model

Size: 32 bit / 4 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 filePath

Size: 32 bit / 4 byte (reference)
The file path 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 snippets that show how the API call engiSaveSchemaBNUnicode can be used.

#include    "./include/ifcengine.h"

void    CreateSchemaFileUnicode(
            )
{
    const std::string model_text{
            "ISO-10303-21;\n"
            "HEADER;\n"
            "FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); \n"
            "FILE_NAME ($, $, (), (), $, $, $);\n"
            "FILE_SCHEMA (('IFC4'));\n"
            "ENDSEC;\n"
            "DATA;\n"
            "#1 = IFCPROPERTYSINGLEVALUE('PropertyName', $, IFCTEXT('test'), #2);\n"
            "#2 = IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);\n"
            "ENDSEC;\n"
            "END-ISO-10303-21;\n"
        };

    SdaiModel   model = engiOpenModelByArray(0, model_text, "");

    if (model) {
        engiSaveSchemaBNUnicode(model, L"c:\\schemas\\IFC4.exp");

        sdaiCloseModel(model);
    }
}