CreateModel

This function creates and empty model. 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 CreateModel(
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t CreateModel(
        );    

Example

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

__int64 rdfModel = CreateModel();

if (rdfModel) {
    __int64 classCone = GetClassByName(rdfModel, "Cone");

    __int64 propertyHeight = GetPropertyByName(rdfModel, "height"),
            propertyRadius = GetPropertyByName(rdfModel, "radius"),
            propertySegmentationParts = GetPropertyByName(rdfModel, "segmentationParts");

    __int64 myInstanceCone = CreateInstance(classCone, nullptr);

    double  height = 2.8,
            radius = 1.3;
    __int64 segmentationParts = 36;
        
    SetDatatypeProperty(myInstanceCone, propertyHeight, &height, 1);
    SetDatatypeProperty(myInstanceCone, propertyRadius, &radius, 1);
    SetDatatypeProperty(myInstanceCone, propertySegmentationParts, &segmentationParts, 1);

    //
    //	The resulting model can be viewed in 3D-Editor.exe
    //
    SaveModel(rdfModel, "c:\\myFile.bin");
    CloseModel(rdfModel);
}