GetNameOfClassW

Returns the name of the class, if the class does not exist it returns nullptr.

Syntax

//   Visual Studio for Windows
public:
void __declspec(dllexport) __stdcall GetNameOfClassW(
            __int64             owlClass,
            wchar_t             ** name
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
void GetNameOfClassW(
            int64_t             owlClass,
            wchar_t             ** name
        );    

Property owlClass

Size: 64 bit / 8 byte (value)
This attribute represents a handle to the class. The term owl is comming from W3C, the classes follow the expression power of Semantic Web concepts, therefore classes support multiple inheritance. Technically classes can also be distributed over different resources, however for this the parametric library is required as an extension on the basic Geometry Kernel API.

Property name

Size: 32 bit / 4 byte (reference)
This attribute represents the name of the class (given as wchar_t array / Unicode). The name is defined in space allocated by the library, this memory will be released as soon as the model is closed, or memory release is forced by CleanMemory.

Example

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

#include 

int64_t model = CreateModel();

if (model) {
    //
    //  Classes
    //
    int64_t myClass = CreateClassW(model, L"MyCreatedClass");

    //
    //  Datatype Properties (attributes)
    //
    int64_t propertyLength = GetPropertyByNameW(model, L"length");

    //
    //  Instances (creating)
    //
    int64_t myInstance = CreateInstanceW(myClass, nullptr);

    double  length = 2.;

    SetDatatypeProperty(myInstance, propertyLength, &length, 1);

    assert(GetVolume(myInstance, 0, 0) == 0.);

    wchar_t * classNameI = nullptr;
    GetNameOfClassW(myClass, &classNameI);

    SetNameOfClassW(myClass, L"OtherClassName");

    wchar_t * classNameII = nullptr;
    GetNameOfClassW(myClass, &classNameII);

    SetClassParent(myClass, GetClassByNameW(model, L"Cube"), 1);

    assert(GetVolume(myInstance, 0, 0) == 8.);

    SetNameOfClassW(myClass, L"OutOfIdeasForClassName");

    wchar_t * classNameIII = nullptr;
    GetNameOfClassW(myClass, &classNameIII);

    //
    //  The retrieved class names have the following values 
    //      classNameI   :  'MyCreatedClass'
    //      classNameII  :  'OtherClassName'
    //      classNameIII :  'OutOfIdeasForClassName'
    //

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