ACAPI_​Database

Controls all of the database dependent operations.

    GSErrCode  ACAPI_Database (
        API_DatabaseID     code,
        void*              par1 = nullptr,
        void*              par2 = nullptr,
        void*              par3 = nullptr
    );

 

Parameters

code
[in] Database function identifier.
par1
[in/out] The parameter depends on the code parameter.
par2
[in/out] The parameter depends on the code parameter.
par3
[in/out] The parameter depends on the code parameter.

 

Return Values

NoError
The function has completed with success.
APIERR_BADID
Invalid code parameter was passed.

More return values can be found at the description of each environment function.

 

Remarks

This function collects all of the database control functions that can be used from an API tool add-on.

It is very important to understand what is the difference between a project window and a database in Archicad.

A Database is a data structure which are associated to a project window. It contains mainly the following database items:

  • elements data,
  • selection information,
  • cursor gravity information,
  • grid parameters
  • the drawing scale,
  • the active zoom etc.

A Project Window is itself make possible to display database information assigned to it.

It is absolutely important to understand the all of the API functions work on the current (active) database and not on the current (active) project window. It means that for example the ACAPI_Element_Create function places a new element into the current database, independently which project window is the active one.

By general you are allowed to switch among the different databases, to specify the target for the subsequent database dependent API operations. Switching the current database do not results that the current project window will be changed. The current database always changed in the background.

When the current project window has been changed for some reason, the current database is changed also.

The type of the database function is specified with the code parameter.

API_DatabaseID

Description

 

 

Database Control Functions

 

APIDb_GetCurrentWindowID

Returns the identifier of current (active) window.

APIDb_ResetCurrentWindowID

Deletes the database elements of the current window and sets up a new, empty environment.

APIDb_NewWindowID

Opens a new window.

APIDb_CloseWindowID

Closes a window.

APIDb_SetWindowIdID

Set a window’s guid.

 

 

Database Control Functions

 

APIDb_GetCurrentDatabaseID

Returns the identifier of the current (active) database.

APIDb_GetDBUnIdFromGuidID  Featuring API 18

Returns the old database identifiers from the database GUID.

APIDb_GetGuidFromDBUnIdID  Featuring API 18

Returns the database GUID from old database identifiers.

APIDb_ResetCurrentDatabaseID

Deletes the database elements of the current database and sets up a new, empty environment.

APIDb_ChangeCurrentDatabaseID

Changes the active database.

APIDb_RedrawCurrentDatabaseID

Redraws the current database, even it’s associated window is in the background.

APIDb_RebuildCurrentDatabaseID

Rebuilds the current database, even it’s associated window is in the background.

APIDb_NewDatabaseID

Creates a new independent detail, layout or master layout database.

APIDb_ModifyDatabaseID  Featuring API 10

Modifies the parameters of an independent detail, layout or master layout database.

APIDb_DeleteDatabaseID  6.1

Deletes an independent detail, layout or master layout database.

APIDb_GetDatabaseInfoID  Featuring API 10

Retrieves information of a given database.

APIDb_GetDetailDatabasesID  6.1

Returns the list of unique IDs of all detail databases.

APIDb_GetWorksheetDatabasesID  6.1

Returns the list of unique IDs of all worksheet databases.

APIDb_GetLayoutDatabasesID  Featuring API 10

Returns the list of unique IDs of all layout databases.

APIDb_GetMasterLayoutDatabasesID  Featuring API 10

Returns the list of unique IDs of all master layout databases.

 

 

General Functions

 

APIDb_AddTextWindowContentID

Adds new lines to the content of a text window.

APIDb_CoordToPointID

Converts a coordinate into pixel in the current database.

APIDb_PointToCoordID

Converts a pixel into coordinate in the current database.

APIDb_GetDrawingScaleID

Returns the drawing scale of the current database.

APIDb_ChangeDrawingScaleID

Changes the drawing scale of the current database.

APIDb_GetGridSettingsID

Returns the grid setting parameters of the current database.

APIDb_ChangeGridSettingsID

Changes the grid setting parameters of the current database.

APIDb_GetZoomID

Returns the actual zoom parameters of the current database.

APIDb_SetZoomID

Sets the zoom parameters of the current database (available from 6.5 R2/v2).

APIDb_ReSetZoomID

Resets the zoom parameters of the current database by a given number of steps.

APIDb_GetExtentID

Returns the drawing extent of the current database.

APIDb_GetExtent3DID

Returns the model extent of the current database.

APIDb_StartClippingSessionID

Sets up temporary database for newly created elements to be clipped.

APIDb_DoClipID

Clips the elements created during the clipping session with the given region and transformation.

APIDb_StopClippingSessionID

Stops the clipping session opened with APIDb_StartClippingSessionID.

APIDb_StartDrawingDataID  Featuring API 10

Redirects element creation into temporary database for creating drawing data.

APIDb_StopDrawingDataID  Featuring API 10

Finalizes the direct creation of drawing elements.

APIDb_DrawOrderInitID

Initializes a loop on the current database to get the elements in the order specified by the BTF/STB system.

APIDb_DrawOrderGetNextID

Returns a reference to the next element of the current database in the order specified by the BTF/STB system.

APIDb_DrawOrderTermID

Terminates the drawing order loop on the current database; cleans up the internal cache.

APIDb_DrawStoryControlID  Featuring API 10

Draws the primitives of the Story Control elements of the given database.

APIDb_CalcBoundsID

Returns the model extent of an element of the current database.

APIDb_RoomReductionsID

Returns reduction data assigned to a room of the current database.

APIDb_GetElementURLRefID

Retrieves the URL reference assigned to an element.

APIDb_SetElementURLRefID

Assigns a URL reference to an element.

APIDb_RefreshElementID

Refreshes a library part instance.

APIDb_DrawElementID

Draws/shows an element.

APIDb_InitCreationOrderTableID  Featuring API 11

Initializes an internal table for fast access of the next element in creation order.

APIDb_CreationOrderGetNextID  Featuring API 11

Returns the next element’s guid from the previously initialized creation order table.

APIDb_DisposeCreationOrderTableID  Featuring API 11

Disposes the previously allocated creation order table.

APIDb_Switch3DSightID

Switches between the 3D databases.

APIDb_GetContainingDatabaseID  Featuring API 12

Obtains the unique ID of database contains the given element.

APIDb_GetElementFromAnywhereID  Featuring API 12

Returns the element irrespectively of the current database.

APIDb_IsCWPanelDegenerateID  Featuring API 12

Checks whether the curtain wall panel is degenerate.

APIDb_SetLast3DDefLevelsID  Featuring API 12

Sets the 3D default levels for the passed construction element types.

APIDb_GetLast3DDefLevelsID  Featuring API 12

Retrieves the 3D default levels for the construction elems.

APIDb_GetRenovationFiltersID  18

Returns the array of renovation filters.

APIDb_GetActualRenovationFilterID  15

Returns the current renovation filter.

APIDb_SetActualRenovationFilterID  15

Changes the current renovation filter.

APIDb_GetElementCategoriesID  19

Returns the array of categories.

APIDb_GetElementCategoryValuesID  19

Returns the array of category values in the given category.

APIDb_GetElementInfoStringID  Featuring API 19

Returns the info string of the given element.

APIDb_ChangeElementInfoStringID  Featuring API 22

Changes the info string of the given element.

 

 

Position Reference Functions

 

APIDb_GetOffsetID  6.1

Returns the origin of the virtual coordinate system.

APIDb_GetLocOrigoID  6.1

Returns the local origin set by the user.

 

 

Drawing Link and View Settings

 

APIDb_GetDrawingLinkID  Featuring API 10

Returns various information on a drawing link.

APIDb_CheckDrawingStatusID  Featuring API 10

Checks whether the given drawing is up-to-date.

APIDb_StoreViewSettingsID  Featuring API 10

Stores/restores the actual view settings.

APIDb_GetTWOwnerID  Featuring API 10

Retrieves the Teamwork owner of a given database.

APIDb_GetSectionDatabasesID  Featuring API 11

Returns the array of section databases.

APIDb_GetElevationDatabasesID  Featuring API 11

Returns the array of elevation databases.

APIDb_GetInteriorElevationDatabasesID  Featuring API 11

Returns the array of interior elevation databases.

APIDb_GetWorksheetDatabasesID  Featuring API 11

Returns the array of worksheet drawing databases.

APIDb_GetDocumentFrom3DDatabasesID  Featuring API 12

Returns the list of unique IDs of all document 3D databases.

APIDb_GetFullDrawingContentBoxID  Featuring API 12

Returns the full boundary box of a drawing’s content.

 

 

Hotlink Management Functions  Featuring API 12

 

APIDb_GetHotlinkNodeID

Returns a hotlink node identified by its guid.

APIDb_CreateHotlinkNodeID

Creates a hotlink node without updating its cache content.

APIDb_ModifyHotlinkNodeID

Modifies the parameters of a hotlink node.

APIDb_DeleteHotlinkNodeID

Deletes a hotlink node identified by its guid.

APIDb_BreakHotlinkNodeID

Breaks the link of a hotlink node identified by its guid.

APIDb_UpdateHotlinkCacheID

Updates the cache of the given hotlink node.

APIDb_GetHotlinkNodesID

Returns the list of hotlink nodes.

APIDb_GetHotlinkRootNodeGuidID

Retrieves the Guid of the Hotlink Module type or XRef type hotlink root node.

APIDb_GetHotlinkNodeTreeID

Retrieves the tree structure under a given hotlink node.

APIDb_GetHotlinkInstancesID

Returns a list of hotlink instance elements placed from the given hotlink node.

APIDb_GetHotlinkProxyElementTableID

Returns the mapping table of the proxy elements and the source elements of the given hotlink instance.

APIDb_GetCompoundInfoStringID

Returns the compound info string of the given element.

APIDb_GetHotLinkOwnerID

Returns the identifier of the hotlink instance the element belongs to.

 

 

Revision Management Functions  Featuring API 12

 

APIDb_GetRVMChangesID

Retrieves all changes.

APIDb_GetRVMChangeCustomSchemeID

Retrieves change custom scheme.

APIDb_GetRVMChangesFromChangeIdsID

Retrieves all changes given by unique change IDs.

APIDb_GetRVMIssuesID

Retrieves all issues.

APIDb_GetRVMIssueCustomSchemeID

Retrieves issue custom scheme.

APIDb_GetRVMDocumentRevisionsID

Retrieves all document revisions.

APIDb_GetRVMIssueDocumentRevisionsID

Retrieves all document revisions belong to the given issue.

APIDb_GetRVMDocumentRevisionChangesID

Retrieves all changes belong to the given document revision.

APIDb_GetRVMLayoutCurrentRevisionChangesID

Retrieves all changes belong to the last revision of the given layout.

APIDb_GetRVMElemChangeIdsID

Retrieves the change IDs of the given elem identified by GUID.

APIDb_GetRVMChangeFirstIssueID

Retrieves the first issue in which the given change is issued.

 

 

Window content validator  Featuring API 22

 

APIDb_BuildWindowValidatorID

Registers a new validator.

APIDb_DestroyWindowValidatorID

Deletes an existing validator.

APIDb_CheckWindowValidatorID

Checks for any changes since the last update of the validator.

APIDb_RebuildWindowValidatorID

Updates the validator.

 

Requirements

Version: API 2.1 or later (certain functions require greater API versions)
Header: ACAPinc.h

 

See Also

General Functions, API Functions