Archicad 29 C++ API
|
Functions exposing the Teamwork functionality of Archicad, including Teamwork project and connection management, rights and permissions management and release/reserve functionalities. More...
Functions | |
GSErrCode | ACAPI_Teamwork_GetTWOwner (API_DatabaseUnId *databaseUnId, short *userId) |
Retrieves the TeamWork owner of a given database. | |
GSErrCode | ACAPI_Teamwork_ProjectSharing (API_SharingInfo *sharingInfo) |
Returns the project sharing data in the case of a TeamWork project. | |
GSErrCode | ACAPI_Teamwork_GetTWAccessRight (API_TWAccessRights accessRight, bool *hasRight) |
Returns if the current user has the specified access right. | |
GSErrCode | ACAPI_Teamwork_GrantElements (const GS::Array< API_Guid > &elemGuids, short toUserId) |
In teamwork mode this function grants the specified elements to the given user. | |
bool | ACAPI_Teamwork_HasConnection (void) |
Tells whether the currently opened project is a Teamwork project. | |
bool | ACAPI_Teamwork_IsOnline (void) |
Tells whether the client is online connected to the BIM server. | |
bool | ACAPI_Teamwork_IsServerLibPart (const IO::Location &location) |
Tells whether the given location refers to a BIM Server Library Part. | |
GSErrCode | ACAPI_Teamwork_GetTeamworkProjectDetails (const IO::Location &twProjectLocation, GS::UniString *serverUrl=nullptr, GS::UniString *projectName=nullptr, GS::UniString *userName=nullptr) |
Extracts details from the given location about the teamwork project. | |
bool | ACAPI_Teamwork_HasCreateRight (const API_Guid &objectId) |
Checks whether the current Teamwork user has access right to create a certain type of object. | |
bool | ACAPI_Teamwork_HasDeleteModifyRight (const API_Guid &objectId) |
Checks whether the current Teamwork user has access right to delete or modify a certain type of object. | |
API_LockableStatus | ACAPI_Teamwork_GetLockableStatus (const API_Guid &objectId, GS::PagedArray< short > *conflicts=nullptr) |
Retrieves the reservation status of a lockable object set. | |
API_Guid | ACAPI_Teamwork_FindLockableObjectSet (const GS::UniString &objectSetName) |
Retrieves the unique identifier of a lockable object set with a string identifier. | |
GSErrCode | ACAPI_Teamwork_ReserveLockable (const API_Guid &objectId, GS::PagedArray< short > *conflicts=nullptr, bool enableDialogs=true) |
Reserves a lockable object set in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_ReleaseLockable (const API_Guid &objectId, bool enableDialogs=true) |
Releases a lockable object set in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_ReserveElements (const GS::Array< API_Guid > &elements, GS::HashTable< API_Guid, short > *conflicts=nullptr, bool enableDialogs=true) |
Reserves elements in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_ReleaseElements (const GS::Array< API_Guid > &elements, bool enableDialogs=true) |
Releases elements in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_ReserveHotlinkCacheManagement (short *conflict=nullptr) |
Reserves the Hotlink/XRef Management in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_ReleaseHotlinkCacheManagement (void) |
Releases the Hotlink/XRef Management in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_GetHotlinkCacheManagementOwner (short *owner) |
Provides the current owner of the Hotlink/XRef Management in Teamwork mode. | |
GSErrCode | ACAPI_Teamwork_GetUsernameFromId (short userId, GS::UniString *username) |
Retrieves the username of a user identified by a short id in a Teamwork project. | |
GSErrCode | ACAPI_Teamwork_SendChanges (const GS::UniString &comment=GS::EmptyUniString) |
Sends changes to the BIMcloud server. | |
GSErrCode | ACAPI_Teamwork_ReceiveChanges () |
Receives changes from the BIMcloud server. | |
GSErrCode | ACAPI_Teamwork_UploadLibraries (const GS::Array< IO::Location > &libraryLocations, const GS::UniString &twServerURL, const GS::UniString &parentPath, GS::Array< GSErrCode > &errorCodesByLocations) |
Uploads the given libraries to the BIMcloud server. | |
GSErrCode | ACAPI_Teamwork_RemoveLibraries (const GS::Array< GS::UniString > &libraryNames, const GS::UniString &twServerURL, const GS::UniString &parentPath, GS::Array< GSErrCode > &errorCodesByLibraries) |
Remove libraries from the BIMcloud server. | |
GSErrCode | ACAPI_RegisterTeamworkReserveInterface (const API_Guid &objectId, short dialogId, short tabId, short tabResId, GSResModule resModule, GSResModule dialogIconResModule, APIReservationTeamWorkPanelParentUIRefreshNeededProc *teamworkPanelParentUIRefreshNeeded, APIReservationTeamWorkPanelParentDataSaveNeededProc *teamworkPanelParentDataSaveNeeded, const GS::UniString &requestMessage, API_TWAccessRights createRight=APINoPermission, API_TWAccessRights deleteModifyRight=APINoPermission) |
Registers an interface supporting reserve/release in teamwork operations. | |
GSErrCode | ACAPI_UnregisterTeamworkReserveInterface (const API_Guid &objectId, short dialogId=0) |
Unregisters a previously registered interface. | |
GSErrCode | ACAPI_RefreshTeamworkReserveInterface (const API_Guid &objectId, short dialogId, bool isTeamWorkPanelParentUIRefreshNeeded=false) |
Refreshes the registered teamwork interface. | |
GSErrCode | ACAPI_Teamwork_SendReleaseCommentMail (const API_Guid &objectId, short dialogId) |
Sends the release comment mail. | |
Functions exposing the Teamwork functionality of Archicad, including Teamwork project and connection management, rights and permissions management and release/reserve functionalities.
This bunch of functions lets your add-on operate in the new Teamwork environment introduced in Archicad 13.
for checking the project status and the online-offline mode:
for checking the user privileges of lockable object sets:
for lockable object set reservation:
for element reservation:
for reservation of the Hotlink/XRef Management
for monitoring reservation changes:
for determining if a given library part is loaded from the BIM server:
for collecting information about the team project, the actual workspace and the effective privileges of the Team Member:
for sending or receiving changes to or from the BIM server:
Lockable object sets are groups of objects (or may consist of a single object) which can be modified separately from the other part of the Teamwork project. Typically attribute containers are lockable object sets. These sets have a special reservation panel on their settings dialog in Teamwork mode to control the exclusive lock on that particular part of the project.
On the API interface lockable object sets are referenced by their object guid. These guids can be obtained with the ACAPI_Teamwork_FindLockableObjectSet function using pre-defined identifiers.
In some cases two or more lockable object sets need to be handled simultaneously, for example they can be locked only in the same user interface at the same time, like the Layers and Layer Combinations in the Layer Settings dialog. These sets are grouped under a special lockable object set, which is called compound lockable object set. Compounds are referenced by a pre-defined name, and their guid can also be retrieved by the ACAPI_Teamwork_FindLockableObjectSet function.
The pre-defined identifier strings of lockable object sets are listed in the Remarks section of ACAPI_Teamwork_FindLockableObjectSet.
The Teamwork_Control example project of the APIDevKit shows samples how to use these functions.
enum API_TWAccessRights |
Represents various access rights in Teamwork projects.
GSErrCode ACAPI_RefreshTeamworkReserveInterface | ( | const API_Guid & | objectId, |
short | dialogId, | ||
bool | isTeamWorkPanelParentUIRefreshNeeded = false ) |
Refreshes the registered teamwork interface.
objectId | [in] The unique identifier of this interface (that you passed during registration). |
dialogId | [in] The dialog ID you registered the interface for. |
isTeamWorkPanelParentUIRefreshNeeded | [in] Update the parent UI as well? |
GSErrCode ACAPI_RegisterTeamworkReserveInterface | ( | const API_Guid & | objectId, |
short | dialogId, | ||
short | tabId, | ||
short | tabResId, | ||
GSResModule | resModule, | ||
GSResModule | dialogIconResModule, | ||
APIReservationTeamWorkPanelParentUIRefreshNeededProc * | teamworkPanelParentUIRefreshNeeded, | ||
APIReservationTeamWorkPanelParentDataSaveNeededProc * | teamworkPanelParentDataSaveNeeded, | ||
const GS::UniString & | requestMessage, | ||
API_TWAccessRights | createRight = APINoPermission, | ||
API_TWAccessRights | deleteModifyRight = APINoPermission ) |
Registers an interface supporting reserve/release in teamwork operations.
objectId | [in] The unique identifier of this interface. |
dialogId | [in] The dialog ID you register the interface for. |
tabId | [in] The tab page ID you register the interface for. |
tabResId | [in] The resource describing the tab page interface elements. |
resModule | [in] The resource module identifier that identifies the module containing the tab page interface elements. |
dialogIconResModule | [in] The resource module identifier that identifies the module containing the tab page icons. |
teamworkPanelParentUIRefreshNeeded | [in] The callback function which is called when you have to refresh the items on the registered interface. |
teamworkPanelParentDataSaveNeeded | [in] The callback function which is called before your panel is closed. You can use this function to set an internal state in your add-on which you can use later to perform teamwork-related operations (e.g., reserve or release AddOnObjects). |
requestMessage | [in] The request message. |
createRight | [in] The teamwork create right you assign to this interface. |
deleteModifyRight | [in] The teamwork delete and modify right you assign to this interface. |
objectId
is APINULLGuid
or dialogId
is 0 or tabId
is 0.objectId
is APINULLGuid
. API_Guid ACAPI_Teamwork_FindLockableObjectSet | ( | const GS::UniString & | objectSetName | ) |
Retrieves the unique identifier of a lockable object set with a string identifier.
objectSetName | [in] String identifier of the lockable object set (see below) |
Object set | Identifier string |
---|---|
Building Materials | "BuildingMaterials" |
Cities | "Cities" |
Composites | "Composites" |
Favorites | "Favorites" |
Fill Types | "FillTypes" |
Layers, Layer Combinations | "LayerSettingsDialog" |
Line Types | "LineTypes" |
Markup Styles | "MarkupStyles" |
MEP Systems | "MEPSystems" |
Model View Options | "ModelViewOptions" |
Operation Profiles | "OperationProfiles" |
Pen Tables | "PenTables" |
Profiles | "Profiles" |
Project Info | "ProjectInfo" |
Project Location | "GeoLocation" |
Project Preferences, Dimension Standards | "PreferencesDialog" |
Graphic Overrides | "GraphicOverrides" |
Surface Materials | "Surfaces" |
Zone Categories | "ZoneCategories" |
GSErrCode ACAPI_Teamwork_GetHotlinkCacheManagementOwner | ( | short * | owner | ) |
Provides the current owner of the Hotlink/XRef Management in Teamwork mode.
owner | [out] userId of the current owner if there is any (must not be nullptr). |
ACAPI_Environment
function with the ACAPI_Teamwork_ProjectSharing function code. The userId of the current Teamwork Client can be retrieved from the API_ProjectInfo structure which can be obtained by calling the ACAPI_Environment
function with the ACAPI_ProjectOperation_Project function code. If the Hotlink/XRef Management is not reserved by anybody the result will be 0. API_LockableStatus ACAPI_Teamwork_GetLockableStatus | ( | const API_Guid & | objectId, |
GS::PagedArray< short > * | conflicts = nullptr ) |
Retrieves the reservation status of a lockable object set.
objectId | [in] Unique identifier of the lockable object set |
conflicts | [out] List of conflicting users (optional, can be nullptr or omitted) |
APILockableStatus_NotExist
- No Teamwork connection, or the passed objectId parameter does not identifies a valid lockable object setAPILockableStatus_Free
- The given lockable object set is available for reservation, not lockedAPILockableStatus_Editable
- The given lockable object set is editable, already reserved by the current userAPILockableStatus_Locked
- The given lockable object set is reserved by someone elseAPILockableStatus_NotAvailable
- Server is offline or not available GSErrCode ACAPI_Teamwork_GetTeamworkProjectDetails | ( | const IO::Location & | twProjectLocation, |
GS::UniString * | serverUrl = nullptr, | ||
GS::UniString * | projectName = nullptr, | ||
GS::UniString * | userName = nullptr ) |
Extracts details from the given location about the teamwork project.
twProjectLocation | [in] The location URI of the teamwork project. |
serverUrl | [out] The URL of the teamwork (BIMcloud) server. |
projectName | [out] The name of the project on the server. |
userName | [out] The username of the logged in user. |
GSErrCode ACAPI_Teamwork_GetTWAccessRight | ( | API_TWAccessRights | accessRight, |
bool * | hasRight ) |
Returns if the current user has the specified access right.
accessRight | [in] The access right to check. |
hasRight | [out] The status of the access right in question. |
GSErrCode ACAPI_Teamwork_GetTWOwner | ( | API_DatabaseUnId * | databaseUnId, |
short * | userId ) |
Retrieves the TeamWork owner of a given database.
databaseUnId | [in] The unique ID of the database |
userId | [out] The TeamWork user ID of the owner of the specified database |
GSErrCode ACAPI_Teamwork_GetUsernameFromId | ( | short | userId, |
GS::UniString * | username ) |
Retrieves the username of a user identified by a short id in a Teamwork project.
userId | [in] Unique identifier of the user |
username | [out] The name of the user |
GSErrCode ACAPI_Teamwork_GrantElements | ( | const GS::Array< API_Guid > & | elemGuids, |
short | toUserId ) |
In teamwork mode this function grants the specified elements to the given user.
elemGuids | [in] The list of the elements which must be granted. |
toUserId | [in] The teamwork owner, to which the objects must be granted. |
bool ACAPI_Teamwork_HasConnection | ( | void | ) |
Tells whether the currently opened project is a Teamwork project.
bool ACAPI_Teamwork_HasCreateRight | ( | const API_Guid & | objectId | ) |
Checks whether the current Teamwork user has access right to create a certain type of object.
objectId | [in] Unique identifier of the object |
bool ACAPI_Teamwork_HasDeleteModifyRight | ( | const API_Guid & | objectId | ) |
Checks whether the current Teamwork user has access right to delete or modify a certain type of object.
objectId | [in] Unique identifier of the object |
bool ACAPI_Teamwork_IsOnline | ( | void | ) |
Tells whether the client is online connected to the BIM server.
bool ACAPI_Teamwork_IsServerLibPart | ( | const IO::Location & | location | ) |
Tells whether the given location refers to a BIM Server Library Part.
location | [in] Location of a library part. |
GSErrCode ACAPI_Teamwork_ProjectSharing | ( | API_SharingInfo * | sharingInfo | ) |
Returns the project sharing data in the case of a TeamWork project.
sharingInfo | data of the registered members of the team project |
GSErrCode ACAPI_Teamwork_ReceiveChanges | ( | ) |
Receives changes from the BIMcloud server.
GSErrCode ACAPI_Teamwork_ReleaseElements | ( | const GS::Array< API_Guid > & | elements, |
bool | enableDialogs = true ) |
Releases elements in Teamwork mode.
elements | [in] List of elements to be released. |
enableDialogs | [in] Show dialogs during the process? (optional, by default the dialogs are enabled) |
GSErrCode ACAPI_Teamwork_ReleaseHotlinkCacheManagement | ( | void | ) |
Releases the Hotlink/XRef Management in Teamwork mode.
GSErrCode ACAPI_Teamwork_ReleaseLockable | ( | const API_Guid & | objectId, |
bool | enableDialogs = true ) |
Releases a lockable object set in Teamwork mode.
objectId | [in] Unique identifier of the lockable object set |
enableDialogs | [in] Show dialogs during the process? |
GSErrCode ACAPI_Teamwork_RemoveLibraries | ( | const GS::Array< GS::UniString > & | libraryNames, |
const GS::UniString & | twServerURL, | ||
const GS::UniString & | parentPath, | ||
GS::Array< GSErrCode > & | errorCodesByLibraries ) |
Remove libraries from the BIMcloud server.
libraryNames | [in] The names of the libraries to remove from the given path. If empty, all libraries will be removed from the given path recursively. |
twServerURL | [in] The URL of the BIMcloud server. |
parentPath | [in] The path on the server where the libraries should be removed from. If empty, the libraries will be removed from the root of the server. |
errorCodesByLibraries | [out] The error codes for each library remove. |
GSErrCode ACAPI_Teamwork_ReserveElements | ( | const GS::Array< API_Guid > & | elements, |
GS::HashTable< API_Guid, short > * | conflicts = nullptr, | ||
bool | enableDialogs = true ) |
Reserves elements in Teamwork mode.
elements | [in] List of elements to be reserved. |
conflicts | [out] List of elements which cannot be reserved (optional, can be nullptr). |
enableDialogs | [in] Show dialogs during the process? (optional, by default the dialogs are enabled) |
GSErrCode ACAPI_Teamwork_ReserveHotlinkCacheManagement | ( | short * | conflict = nullptr | ) |
Reserves the Hotlink/XRef Management in Teamwork mode.
conflict | [out] userId of the current owner if there is any (optional, can be nullptr). |
ACAPI_Environment
function with the ACAPI_Teamwork_ProjectSharing function code. The userId of the current Teamwork Client can be retrieved from the API_ProjectInfo structure which can be obtained by calling the ACAPI_Environment
function with the ACAPI_ProjectOperation_Project function code. 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. GSErrCode ACAPI_Teamwork_ReserveLockable | ( | const API_Guid & | objectId, |
GS::PagedArray< short > * | conflicts = nullptr, | ||
bool | enableDialogs = true ) |
Reserves a lockable object set in Teamwork mode.
objectId | [in] Unique identifier of the lockable object set |
conflicts | [out] List of conflicting users (optional, can be nullptr or omitted) |
enableDialogs | [in] Show dialogs during the process? (optional, by default the dialogs are enabled) |
GSErrCode ACAPI_Teamwork_SendChanges | ( | const GS::UniString & | comment = GS::EmptyUniString | ) |
Sends changes to the BIMcloud server.
comment | [in] Comment attached to the Send operation. |
GSErrCode ACAPI_Teamwork_SendReleaseCommentMail | ( | const API_Guid & | objectId, |
short | dialogId ) |
Sends the release comment mail.
objectId | [in] The unique identifier of this interface (that you passed during registration). |
dialogId | [in] The dialog ID you registered the interface for. |
GSErrCode ACAPI_Teamwork_UploadLibraries | ( | const GS::Array< IO::Location > & | libraryLocations, |
const GS::UniString & | twServerURL, | ||
const GS::UniString & | parentPath, | ||
GS::Array< GSErrCode > & | errorCodesByLocations ) |
Uploads the given libraries to the BIMcloud server.
libraryLocations | [in] The locations of the libraries to upload. |
twServerURL | [in] The URL of the BIMcloud server. |
parentPath | [in] The path on the server where the libraries should be uploaded. |
errorCodesByLocations | [out] The error codes for each library location upload. |
GSErrCode ACAPI_UnregisterTeamworkReserveInterface | ( | const API_Guid & | objectId, |
short | dialogId = 0 ) |
Unregisters a previously registered interface.
objectId | [in] The unique identifier of this interface (that you passed during registration). |
dialogId | [out] The dialog ID you registered the interface for. |
objectId
is not registered.