APIEnv_​OverwriteLibPartID

Sets the overwrite mode for the library part create function.

    GSErrCode ACAPI_Environment (
        APIEnv_OverwriteLibPartID,
        bool     overwriteOn
    );

 

Parameters

overwriteOn
[in] Switch ON or OFF the overwrite mode.

 

Return Values

The function always returns NoError.

 

Remarks

This function is used to configure the ACAPI_LibPart_Create function to overwrite an existing library part instead of creating a new one with unique name.

The parameter should be pass as a value, instead of a pointer. See the example.

 

Example


API_LibPart      libPart;
GSErrCode        err;

BNZeroMemory (&libPart, sizeof (API_LibPart));
libPart.typeID = APILib_ObjectID;
libPart.ownerID = APIOwnerID_ArchiCAD;
GS::ucscpy (libPart.docu_UName, L("Toilet P Dispenser 15"));

/* replace the existing the library part */

err = ACAPI_LibPart_Search (&libPart, false);
if (err == NoError) {
    ACAPI_Environment (APIEnv_OverwriteLibPartID, (void *) (Int32) true, nullptr);
    err = ACAPI_LibPart_Create (&libPart);
    ACAPI_Environment (APIEnv_OverwriteLibPartID, (void *) (Int32) false, nullptr);
}

 

Requirements

Version: API 2.1 or later
Header: APIdefs_Environment.h

 

See Also

ACAPI_LibPart_Create,
ACAPI_Environment, API Functions