OpenModelW

This function opens the model on location fileName.
References inside to other ontologies will be included.
A handle to the model will be returned, or 0 in case something went wrong.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall OpenModelW(
            const wchar_t       * fileName
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t OpenModelW(
            const wchar_t       * fileName
        );    

Property fileName

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

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

#include "engine/include/engine.h"

int64_t GetFileInstanceCount(wchar_t * fileName)
{
    int64_t instanceCount = 0,
            model = OpenModelW(fileName);
    
    if (model) {
        int64_t myInstance = GetInstancesByIterator(model, 0);

        while (myInstance) {
            instanceCount++;
            myInstance = GetInstancesByIterator(model, myInstance);
        }

        CloseModel(model);
    }

    return  instanceCount;
}

int main()
{
    int64_t noInstances = GetFileInstanceCount(L"c:\\created\\myFile.bin");
}