Skip to content

Project Data

Store and retrieve script data in the project, including module data and reservation controls.

Access this group through api.tapir.project_data.

Commands

For exceptions shared by Unified API commands, see error handling.

delete_modul_data

delete_modul_data(
    names: list[str],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes the module data with the given names. Deleting module data is not an undoable step.

Parameters:

  • names (list[str]) –

    The names of the module data to delete; the empty name is the default section.

Returns:

delete_project_data

delete_project_data(
    names: list[str],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes the project data with the given names.

Parameters:

  • names (list[str]) –

    The names of the project data to delete.

Returns:

get_modul_data

get_modul_data(
    names: None | list[str] = None,
    include_content: None | bool = None,
) -> list[ErrorItem | ModulData]

Gets the module data Tapir stored in the project with StoreModulData: the given names, or all of them, with their data version and, unless includeContent is false, their content. Module data are the custom data sections of Archicad's ModulData Manager: text saved in the project file under a name, kept apart from project data (SetProjectData).

Parameters:

  • names (None | list[str], default: None ) –

    The names of the module data to get; the empty name is the default section. When omitted, every module data Tapir stored in the project is returned.

  • include_content (None | bool, default: None ) –

    Whether the content is returned too. When false, only the names and data versions are read, without loading the data. The default is true.

Returns:

  • list[ErrorItem | ModulData] –

    The module data in the order of the given names (or of the list Archicad returns), or an error for a name that has no module data.

get_project_data

get_project_data(
    names: list[str],
) -> list[ErrorItem | ProjectDataValue]

Gets the content of the project data with the given names.

Parameters:

  • names (list[str]) –

    The names of the project data to get.

Returns:

  • list[ErrorItem | ProjectDataValue] –

    The project data in the order of the given names, or an error for a name that has no project data.

get_project_data_keys

get_project_data_keys() -> list[ProjectDataKey]

Lists the project data stored by Tapir in the project: the names, the identifiers of the add-on objects that store them, whether they are kept on this client only and the Teamwork user who has reserved them. Project data is text (for example JSON) saved in the project file by scripts and Grasshopper definitions, such as their settings or the mapping of elements to an external system.

Returns:

  • list[ProjectDataKey] –

    The project data stored by Tapir in the project.

grant_project_data

grant_project_data(
    names: list[str], to_user_id: int
) -> SuccessfulExecutionResult

Grants the project data with the given names, reserved by the current user, to another Teamwork user.

Parameters:

  • names (list[str]) –

    The names of the project data, reserved by the current user, to grant.

  • to_user_id (int) –

    The Teamwork user id of the user who gets the project data, for example the userId of a user returned by GetProjectDataKeys or ReserveProjectData.

Returns:

release_project_data

release_project_data(
    names: list[str],
) -> SuccessfulExecutionResult

Releases the project data with the given names in Teamwork.

Parameters:

  • names (list[str]) –

    The names of the project data to release.

Returns:

request_project_data

request_project_data(
    names: list[str], mail_text: None | str = None
) -> SuccessfulExecutionResult

Requests the project data with the given names in Teamwork from the users who have reserved it, with an optional message.

Parameters:

  • names (list[str]) –

    The names of the project data to request from the users who have reserved them.

  • mail_text (None | str, default: None ) –

    The message sent with the request. The default is empty.

Returns:

reserve_project_data

reserve_project_data(
    names: list[str],
) -> ReserveProjectDataResult

Reserves the project data with the given names in Teamwork, so that other users cannot change it. Returns the users who have already reserved some of it.

Parameters:

  • names (list[str]) –

    The names of the project data to reserve.

Returns:

set_project_data

set_project_data(
    values: list[ProjectDataValueData],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Creates or overwrites project data: text (for example JSON) saved in the project under a name. New project data can be kept on this client only, or created as unique so that in Teamwork only one can exist with its name. Prefix the names with the name of your tool (for example 'my-tool/settings') so scripts do not overwrite each other's data.

Parameters:

  • values (list[ProjectDataValueData]) –

    The project data to create or to overwrite. Prefix the names with the name of your tool (for example 'my-tool/settings') so different scripts do not overwrite each other's data.

Returns:

store_modul_data

store_modul_data(
    modul_data: list[ModuleDataEntry],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Creates or overwrites module data: text (for example JSON) saved in the project under a name, with an optional data version. Prefix the names with the name of your tool (for example 'my-tool/settings') so scripts do not overwrite each other's data. Storing module data is not an undoable step.

Parameters:

  • modul_data (list[ModuleDataEntry]) –

    The module data to create or to overwrite. Prefix the names with the name of your tool (for example 'my-tool/settings') so different scripts do not overwrite each other's data.

Returns:

These include the parameter and result models used inside the client. The command signatures above show what to pass and what is returned.