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.
Description
Database Control Functions
Returns the identifier of current (active) window.
Deletes the database elements of the current window and sets up a new, empty environment.
Opens a new window.
Closes a window.
Set a window’s guid.
Database Control Functions
Returns the identifier of the current (active) database.
Returns the old database identifiers from the database GUID.
Returns the database GUID from old database identifiers.
Deletes the database elements of the current database and sets up a new, empty environment.
Changes the active database.
Redraws the current database, even it’s associated window is in the background.
Rebuilds the current database, even it’s associated window is in the background.
Creates a new independent detail, layout or master layout database.
Modifies the parameters of an independent detail, layout or master layout database.
Deletes an independent detail, layout or master layout database.
Retrieves information of a given database.
Returns the list of unique IDs of all detail databases.
Returns the list of unique IDs of all worksheet databases.
Returns the list of unique IDs of all layout databases.
Returns the list of unique IDs of all master layout databases.
General Functions
Adds new lines to the content of a text window.
Converts a coordinate into pixel in the current database.
Converts a pixel into coordinate in the current database.
Returns the drawing scale of the current database.
Changes the drawing scale of the current database.
Returns the grid setting parameters of the current database.
Changes the grid setting parameters of the current database.
Returns the actual zoom parameters of the current database.
Sets the zoom parameters of the current database (available from 6.5 R2/v2).
Resets the zoom parameters of the current database by a given number of steps.
Returns the drawing extent of the current database.
Returns the model extent of the current database.
Sets up temporary database for newly created elements to be clipped.
Clips the elements created during the clipping session with the given region and transformation.
Stops the clipping session opened with
APIDb_StartClippingSessionID
.Redirects element creation into temporary database for creating drawing data.
Finalizes the direct creation of drawing elements.
Initializes a loop on the current database to get the elements in the order specified by the BTF/STB system.
Returns a reference to the next element of the current database in the order specified by the BTF/STB system.
Terminates the drawing order loop on the current database; cleans up the internal cache.
Draws the primitives of the Story Control elements of the given database.
Returns the model extent of an element of the current database.
Returns reduction data assigned to a room of the current database.
Retrieves the URL reference assigned to an element.
Assigns a URL reference to an element.
Refreshes a library part instance.
Draws/shows an element.
Initializes an internal table for fast access of the next element in creation order.
Returns the next element’s
guid
from the previously initialized creation order table.Disposes the previously allocated creation order table.
Switches between the 3D databases.
Obtains the unique ID of database contains the given element.
Returns the element irrespectively of the current database.
Checks whether the curtain wall panel is degenerate.
Sets the 3D default levels for the passed construction element types.
Retrieves the 3D default levels for the construction elems.
Returns the array of renovation filters.
Returns the current renovation filter.
Changes the current renovation filter.
Returns the array of categories.
Returns the array of category values in the given category.
Returns the info string of the given element.
Changes the info string of the given element.
Position Reference Functions
Returns the origin of the virtual coordinate system.
Returns the local origin set by the user.
Drawing Link and View Settings
Returns various information on a drawing link.
Checks whether the given drawing is up-to-date.
Stores/restores the actual view settings.
Retrieves the Teamwork owner of a given database.
Returns the array of section databases.
Returns the array of elevation databases.
Returns the array of interior elevation databases.
Returns the array of worksheet drawing databases.
Returns the list of unique IDs of all document 3D databases.
Returns the full boundary box of a drawing’s content.
Hotlink Management Functions
Returns a hotlink node identified by its guid.
Creates a hotlink node without updating its cache content.
Modifies the parameters of a hotlink node.
Deletes a hotlink node identified by its guid.
Breaks the link of a hotlink node identified by its guid.
Updates the cache of the given hotlink node.
Returns the list of hotlink nodes.
Retrieves the Guid of the Hotlink Module type or XRef type hotlink root node.
Retrieves the tree structure under a given hotlink node.
Returns a list of hotlink instance elements placed from the given hotlink node.
Returns the mapping table of the proxy elements and the source elements of the given hotlink instance.
Returns the compound info string of the given element.
Returns the identifier of the hotlink instance the element belongs to.
Revision Management Functions
Retrieves all changes.
Retrieves change custom scheme.
Retrieves all changes given by unique change IDs.
Retrieves all issues.
Retrieves issue custom scheme.
Retrieves all document revisions.
Retrieves all document revisions belong to the given issue.
Retrieves all changes belong to the given document revision.
Retrieves all changes belong to the last revision of the given layout.
Retrieves the change IDs of the given elem identified by GUID.
Retrieves the first issue in which the given change is issued.
Window content validator
Registers a new validator.
Deletes an existing validator.
Checks for any changes since the last update of the validator.
Updates the validator.
Requirements
- Version: API 2.1 or later (certain functions require greater API versions)
- Header: ACAPinc.h