OpenModel

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 OpenModel(
            const char          * fileName
        );

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

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.

Example

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

#include "engine/include/engine.h"

int64_t GetFileInstanceCount(char * fileName)
{
    int64_t instanceCount = 0,
            model = OpenModel(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("c:\\created\\myFile.bin");
}