APIDb_​DeleteDatabaseID

Deletes an independent detail, worksheet, layout, or master layout database.

    GSErrCode ACAPI_Database (
        APIDb_DeleteDatabaseID,
        API_DatabaseInfo*     databaseInfo
    );

 

Parameters

databaseInfo Featuring API 10
[in] parameters of the database to be deleted

 

Return Values

NoError
The function has completed with success.
APIERR_NOPLAN
no floor plan window opened
APIERR_BADPARS
api_dbInfo is nullptr, or contains invalid database reference
APIERR_REFUSEDPAR
the passed typeID is not APIWind_DetailID, APIWind_WorksheetID, APIWind_LayoutID or APIWind_MasterLayoutID
APIERR_REFUSEDCMD
attempted to delete database during signing in a Teamwork file
APIERR_NOTMINE
unsufficient privileges to delete database in Teamwork mode
APIERR_GENERAL
failed to delete the database

For other common API errors see the API Errors document.

 

Remarks

This function is used to delete an independent detail drawing, worksheet layout or master layout database. This operation is not undoable.

This function performs complete operations, so it cannot be called neither during undoable operations nor during non-undoable commands. See more details on this topic at Command Overview.

 

Example


API_DatabaseInfo dbInfo;
BNZeroMemory (&dbInfo, sizeof (API_DatabaseInfo));

GSErrCode err = ACAPI_Database (APIDb_GetCurrentDatabaseID, &dbInfo, nullptr);
if (err == NoError && dbInfo.typeID == APIWind_LayoutID)
    ACAPI_Database (APIDb_DeleteDatabaseID, &dbInfo, nullptr);

 

Requirements

Version: API 6.1 or later
Header: APIdefs_Database.h

 

See Also

API_DatabaseInfo
APIDb_NewDatabaseID, APIDb_ModifyDatabaseID, APIDb_GetDatabaseInfoID
APIDb_GetCurrentDatabaseID, APIDb_ChangeCurrentDatabaseID
ACAPI_Database, API Functions