CreateInstance

Returns a handle to an on the fly created instance. If the _class input is zero or not a class handle 0 will be returned,

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall CreateInstance(
            __int64        owlClass,
            const wchar_t   * owlInstanceName
        );

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

Property owlClass

Size: 64 bit / 8 byte (value)
...

Property owlInstanceName

Size: 64 bit / 8 byte (reference)
the name of the owlInstance

Example

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

__int64 rdfModel = CreateModel();

if (rdfModel) {
    __int64 classArc3D = GetClassByName(rdfModel, "Arc3D");

    __int64 propertyRadius = GetPropertyByName(rdfModel, "radius"),
            propertyStart = GetPropertyByName(rdfModel, "start"),
            propertySize = GetPropertyByName(rdfModel, "size"),
            propertySegmentationParts = GetPropertyByName(rdfModel, "segmentationParts");

    __int64 myInstanceArc3D = CreateInstance(classArc3D, nullptr);

    double  Pi = 2. * acos(0.),
            radius = 2.1,
            start = 0.,
            size = 2. * Pi;
    __int64 segmentationParts = 36;
        
    SetDatatypeProperty(myInstanceArc3D, propertyRadius, &radius, 1);
    SetDatatypeProperty(myInstanceArc3D, propertyStart, &start, 1);
    SetDatatypeProperty(myInstanceArc3D, propertySize, &size, 1);
    SetDatatypeProperty(myInstanceArc3D, propertySegmentationParts, &segmentationParts, 1);

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