Modifies the parameters of an independent detail, worksheet, layout or master layout database.
GSErrCode ACAPI_Database ( APIDb_ModifyDatabaseID, API_DatabaseInfo* databaseInfo );
Parameters
- databaseInfo
- [in/out] parameters of the database to be created
Return Values
NoError
- the function has completed with success.
APIERR_NOPLAN
- no floor plan window opened
APIERR_BADPARS
databaseInfo
isnullptr
APIERR_REFUSEDPAR
- the passed
typeID
is notAPIWind_DetailID
,APIWind_WorksheetID
,APIWind_LayoutID
orAPIWind_MasterLayoutID
APIERR_REFUSEDCMD
- attempted to modify database parameters during signing in a Teamwork file
APIERR_NOTMINE
- unsufficient privileges to modify database parameters in Teamwork mode
APIERR_GENERAL
- failed to modify the database parameters
For other common API errors see the API Errors document.
Remarks
With this function you can rename an independent detail, worksheet, layout or master layout database, and change their reference ID.
Note that you cannot change the title
parameter of the database.
You can also change the Master of a Layout database by passing a valid masterLayoutUnId
.
This function is a non-undoable data structure modifier function. 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) { CHCopyC ("Renamed Layout", dbInfo.name); ACAPI_Database (APIDb_ModifyDatabaseID, &dbInfo, nullptr); }
Requirements
- Version: API 10 or later
- Header: APIdefs_Database.h
See Also
API_DatabaseInfo
APIDb_NewDatabaseID, APIDb_DeleteDatabaseID, APIDb_GetDatabaseInfoID
APIDb_GetCurrentDatabaseID, APIDb_ChangeCurrentDatabaseID, APIDb_NewWindowID
ACAPI_Database, API Functions