GetGeneric

Returns a true or false value depending on whether the operation to retrieve the generic properties with the provided external index is successful. When the operation is successful, the function returns the number of generic entities present in the model and generic properties for the provided external generic index.

Calling convention:

bool GetGeneric (int id, char* string1, char* string2, int* iarr, double* rarr)
Note:

To access this method, you must use the GetTMGFunction method and include the AdditionalFunctions.h file located in the [installation_path]\tmg\include\maya\expeval_utils folder in the beginning of your source file.

Argument Data type Description
id int The external label for the generic entity.
string1 char* The generic entity string.
string2 char* The generic entity substring.
iarr int* The array of 8 integer numbers associated with the generic entity.
rarr double* The array of 8 double numbers associated with the generic entity.

Example:

#include <ITMGFuncService.h>

// Initialize functions available only in the solver but not in NX
#ifdef _WIN32
extern "C" __declspec(dllexport) void TMGUserInitialize(void* pGetTMGFunc)
#else
extern "C" void TMGUserInitialize(void* pGetTMGFunc)
#endif
{
    // Generic function to get access to solver function
    pGetTMGFunction = (GetTMGFunctionPointer)pGetTMGFunc;
    pGetGenericIndex = (GetGenericIndexPointer)pGetTMGFunction(getGenericIndexString);
    pGetGeneric = (GetGenericPointer)pGetTMGFunction(getGenericString);

    // Get all the generic entities and populate Singleton containers
    int numGenerics = 0;
    int intIndex = 0, extIndex = 0;
    pGetGenericIndex(&intIndex, &Index, &numGenerics);
    // Values for the generic entities
    int integers[8];
    double doubles[8];
    char text1[80], text2[80];  
    // Dummy variable for the function call
    int numGenerics2 = 0;
    // Notice that enumeration starts with 1
    for (intIndex = 1; intIndex <= numGenerics; ++intIndex)
    {
        pGetGenericIndex(&intIndex, &extIndex, &numGenerics2);
        pGetGeneric(extIndex, text1, text2, &integers, &doubles);
    }
}