Returns the default parameters of a registered Library Part.

    GSErrCode  ACAPI_LibPart_GetParams (
        Int32                 libInd,
        double*               a,
        double*               b,
        Int32*                addParNum,
        API_AddParType***     addPars



Index of the library part.
The A parameter of the the Library Part
The B parameter of the the Library Part
The number of additive parameters; others than A and B
The additive parameters


Return Values

The function has completed with success.
Invalid libInd, or
any of the parameters are nullptr, or
the addressed Library Part is a macro, picture file etc.
not enough memory to complete the operation

For other common API errors see the API Errors.



This function is used to get the default parameters of the requested Library Part defined by libInd.

In the a and b parameters, the values of the A and B variables are returned; in the addParNum and addPars parameters the additive parameter list is returned, the number of the parameters and the actual values, respectively.

Refer to the API_AddParType to get more information on a Library Part parameter.

It is absolutely important that the function returns a formalized data handle to describe the parameter list. The content is not equal to the section handle returned by the ACAPI_LibPart_GetSection function called with the API_SectParamDef argument.

The function works only on real Library Parts. In the case the type of the target Library Part is not listed below, the function returns an error code. This is since other type of Library Parts are just simple picture or text files which are enumerated and registered from the active library folders; such a picture or macro.

Applicable type of Library Parts which have parameter list are:

Do not forget to dispose the additive parameter handle if it is not needed any more. Use the ACAPI_DisposeAddParHdl function for this purpose.



static void  DumpParameters (Int32 libInd, API_LibTypeID typeID)

    API_LibPartDetails   details;
    double               a, b;
    Int32                addParNum, i, ind, i1, i2;
    API_AddParType       **addPars = nullptr;
    double               value;
    char                 *valueStr;
    GSErrCode            err;

    err = ACAPI_LibPart_GetParams (libInd, &a, &b, &addParNum, &addPars);
    if (err) {
        GiveMessage_Err ("ACAPI_LibPart_GetParams", err);

    GiveMessage_Val ("    a", a, false);
    GiveMessage_Val ("    b", b, false);
    for (i = 0; i < addParNum; i++) {
        if ((*addPars)[i].typeMod == API_ParSimple) {
            DumpOneParam ((*addPars)[i].typeID, (*addPars)[i].name, (*addPars)[i].flags,
                          (*addPars)[i].value.real, (*addPars)[i].value.str,

        } else {
            ind = 0;
            DumpOneParam ((*addPars)[i].typeID, (*addPars)[i].name, (*addPars)[i].flags,
                          0.0, nullptr,
                          -(*addPars)[i].dim1, -(*addPars)[i].dim2);
            for (i1 = 1; i1 <= (*addPars)[i].dim1; i1++) {
                for (i2 = 1; i2 <= (*addPars)[i].dim2; i2++) {
                    if ((*addPars)[i].typeID != APIParT_CString) {
                        value = (Int32) ((double *) *(*addPars)[i].value.array) [ind];
                        valueStr = nullptr;
                        ind ++;
                    } else {
                        value = 0.0;
                        valueStr = *(*addPars)[i].value.array + ind;
                        ind += strlen (valueStr) + 1;
                    DumpOneParam ((*addPars)[i].typeID, nullptr, 0,
                                  value, valueStr,
                                  i1, i2);
    ACAPI_DisposeAddParHdl (&addPars);

    if (typeID == APILib_ObjectID ||
        typeID == APILib_LampID ||
        typeID == APILib_LabelID ||
        typeID == APILib_RoomID) {
        err = ACAPI_LibPart_GetDetails (libInd, &details);
        if (!err) {
            GiveMessage_Num ("    fixSize", details.object.fixSize, false);
            GiveMessage_Num ("    autoHsp", details.object.autoHotspot, false);

    if (typeID == APILib_DoorID ||
        typeID == APILib_WindowID) {
        err = ACAPI_LibPart_GetDetails (libInd, &details);


See the implementation of the DumpOneParam function in API_AddParType.



Version: API 1.3 or later
Header: ACAPinc.h


See Also

LibPart Manager, API Functions