Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/documentation/enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,10 @@
rendering:
show_root_heading: false
show_source: true

## Language

::: cadwork.language
rendering:
show_root_heading: false
show_source: true
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cwapi3d"
version = "33.300.0"
version = "33.307.0"
authors = [{ name = "Cadwork", email = "it@cadwork.ca" }]
requires-python = ">= 3.14"
description = 'Python bindings for CwAPI3D'
Expand Down
2 changes: 2 additions & 0 deletions src/cadwork/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ from .hundegger_machine_type import hundegger_machine_type as hundegger_machine_
from .ifc_2x3_element_type import ifc_2x3_element_type as ifc_2x3_element_type
from .ifc_element_combine_behaviour import ifc_element_combine_behaviour as ifc_element_combine_behaviour
from .ifc_predefined_type import ifc_predefined_type as ifc_predefined_type
from .language import language as language
from .multi_layer_cover_type import multi_layer_cover_type as multi_layer_cover_type
from .multi_layer_subtype import multi_layer_subtype as multi_layer_subtype
from .multi_layer_type import multi_layer_type as multi_layer_type
Expand Down Expand Up @@ -153,6 +154,7 @@ __all__ = [
"ifc_2x3_element_type",
"ifc_element_combine_behaviour",
"ifc_predefined_type",
"language",
"multi_layer_cover_type",
"multi_layer_subtype",
"multi_layer_type",
Expand Down
50 changes: 50 additions & 0 deletions src/cadwork/language.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from enum import IntEnum, unique


@unique
class language(IntEnum):
"""Available cadwork UI languages for set_language().

The numeric values are cadwork language IDs; each member is documented with the ISO code returned by get_language().

Examples:
>>> cadwork.language.german
german
"""
english = 0
"""en"""
german = 1
"""de"""
french = 2
"""fr"""
italian = 3
"""it"""
spanish = 4
"""es"""
czech = 5
"""cs"""
finnish = 6
"""fi"""
russian = 7
"""ru"""
polish = 8
"""pl"""
romanian = 9
"""ro"""
norwegian = 10
"""no"""
chinese = 11
"""zh"""
portuguese = 12
"""pt"""
estonian = 13
"""et"""
japanese = 14
"""ja"""
dutch = 15
"""nl"""
swedish = 16
"""sv"""

def __int__(self) -> int:
return self.value
22 changes: 22 additions & 0 deletions src/utility_controller/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ from cadwork.point_3d import point_3d
from cadwork.window_geometry import window_geometry
from cadwork.shortcut_key import shortcut_key
from cadwork.shortcut_key_modifier import shortcut_key_modifier
from cadwork.language import language


def get_3d_version() -> int:
Expand Down Expand Up @@ -65,6 +66,27 @@ def get_language() -> str:
"""


def set_language(lang: language) -> None:
"""Sets the 3D language and refreshes the UI.

Examples:
>>> import utility_controller as uc
>>> import cadwork
>>> uc.set_language(cadwork.language.german)

Parameters:
lang: The language to set.
"""


def get_language_enum() -> language:
"""Gets the 3D language as a typed enum.

Returns:
The active language.
"""


def print_message(message: str, row: int, column: int) -> None:
"""Prints a message that will be visualized in the bottom toolbar of the
3D view. You can arrange the message in the desired position by specifying the row and column.
Expand Down
Loading