From 63c9d48c96aca2526fe0792864a137044a603516 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Paquet Date: Fri, 14 Aug 2026 10:29:17 -0400 Subject: [PATCH 1/7] Updates build process and switches to uv. --- .editorconfig | 18 + .gitattributes | 1 + .github/workflows/ci.yml | 21 + .github/workflows/publish.yml | 19 +- .github/workflows/test_publish.yml | 39 -- .pip-tools.toml | 4 - .pre-commit-config.yaml | 12 + .readthedocs.yaml | 7 +- LICENSE | 2 +- pyproject.toml | 75 +-- requirements.in | Bin 188 -> 0 bytes requirements.txt | 127 ----- uv.lock | 830 +++++++++++++++++++++++++++++ 13 files changed, 941 insertions(+), 214 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test_publish.yml delete mode 100644 .pip-tools.toml create mode 100644 .pre-commit-config.yaml delete mode 100644 requirements.in delete mode 100644 requirements.txt create mode 100644 uv.lock diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..82532c6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +# end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 +charset = utf-8 + +[*.{bat,cmd,ps1}] +end_of_line = crlf + +[*.sh] +end_of_line = lf + +[LICENSE] +insert_final_newline = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a6cacae --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: Test Publish CwAPI3D Package + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + - run: uv python install 3.14 + - run: uv run pytest --cov --cov-branch --cov-report=xml + - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + - run: uv run black --check . + - run: uv build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8377eda..35ec18c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish CwAPI3D Package +name: Publish cwapi3d Package on: push: @@ -7,8 +7,7 @@ on: jobs: build-and-publish: - name: Build and Publish - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/cwapi3d @@ -16,8 +15,8 @@ jobs: id-token: write contents: read steps: - - uses: actions/checkout@v6 - - uses: dorny/paths-filter@v4.0.1 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes with: filters: | @@ -25,12 +24,10 @@ jobs: - 'src/**' - 'pyproject.toml' - if: steps.changes.outputs.src == 'true' - uses: actions/setup-python@v6 - with: - python-version: '3.14' + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 - if: steps.changes.outputs.src == 'true' - run: pip install build + run: uv python install 3.14 - if: steps.changes.outputs.src == 'true' - run: python -m build + run: uv build - if: steps.changes.outputs.src == 'true' - uses: pypa/gh-action-pypi-publish@release/v1.14 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml deleted file mode 100644 index 41d3b98..0000000 --- a/.github/workflows/test_publish.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Test Publish CwAPI3D Package - -on: - push: - branches-ignore: - - 'main' - -jobs: - build-and-publish: - name: Test Build and Publish - runs-on: 'ubuntu-latest' - environment: - name: testpypi - url: https://test.pypi.org/p/cwapi3d - permissions: - id-token: write - contents: read - steps: - - uses: actions/checkout@v6 - - uses: dorny/paths-filter@v4.0.1 - id: changes - with: - filters: | - src: - - 'src/**' - - 'pyproject.toml' - - if: steps.changes.outputs.src == 'true' - uses: actions/setup-python@v6 - with: - python-version: '3.14' - - if: steps.changes.outputs.src == 'true' - run: pip install build - - if: steps.changes.outputs.src == 'true' - run: python -m build - - if: steps.changes.outputs.src == 'true' - uses: pypa/gh-action-pypi-publish@release/v1.14 - with: - repository-url: https://test.pypi.org/legacy/ - skip-existing: true diff --git a/.pip-tools.toml b/.pip-tools.toml deleted file mode 100644 index 9784ab5..0000000 --- a/.pip-tools.toml +++ /dev/null @@ -1,4 +0,0 @@ -[tool.pip-tools] -generate-hashes = true -allow-unsafe = true -strip-extras = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..35fcf57 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-illegal-windows-names + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: forbid-submodules + - id: no-commit-to-branch + - id: trailing-whitespace diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 983aa11..b06eab0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,5 +9,8 @@ mkdocs: configuration: mkdocs.yml python: - install: - - requirements: requirements.txt + install: + - method: uv + command: sync + groups: + - dev diff --git a/LICENSE b/LICENSE index fdaae03..c0cbac8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Cadwork +Copyright (c) 2026 Cadwork Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pyproject.toml b/pyproject.toml index 0d83a9e..f64be90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [project] name = "cwapi3d" -version = "33.333.1" +version = "33.333.2" authors = [{ name = "Cadwork", email = "it@cadwork.ca" }] requires-python = ">= 3.14" description = 'Python bindings for CwAPI3D' readme = "README.md" license-files = [ "LICENSE" ] -keywords = ["cadwork"] +keywords = [ "cadwork" ] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", @@ -21,36 +21,51 @@ classifiers = [ [project.urls] Homepage = "https://github.com/cwapi3d/cwapi3dpython" +[dependency-groups] +dev = [ + "black>=26.5.1", + "mkdocs>=1.6.1", + "mkdocs-autorefs>=1.4.4", + "mkdocs-material>=9.7.7", + "mkdocstrings[python]>=1.0.6", + "pre-commit>=4.6.2", + "pytest>=9.1.1", + "pytest-cov>=7.1.0", + "ruff>=0.16.3", +] + [build-system] -requires = ["setuptools>=61.0"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.setuptools] +[tool.hatch.build.targets.wheel] packages = [ - "attribute_controller", - "bim_controller", - "cadwork", - "connector_axis_controller", - "dimension_controller", - "element_controller", - "endtype_controller", - "file_controller", - "geometry_controller", - "list_controller", - "machine_controller", - "material_controller", - "menu_controller", - "multi_layer_cover_controller", - "roof_controller", - "scene_controller", - "shop_drawing_controller", - "utility_controller", - "visualization_controller" + "src/attribute_controller", + "src/bim_controller", + "src/cadwork", + "src/connector_axis_controller", + "src/dimension_controller", + "src/element_controller", + "src/endtype_controller", + "src/file_controller", + "src/geometry_controller", + "src/list_controller", + "src/machine_controller", + "src/material_controller", + "src/menu_controller", + "src/multi_layer_cover_controller", + "src/roof_controller", + "src/scene_controller", + "src/shop_drawing_controller", + "src/utility_controller", + "src/visualization_controller", ] -package-dir = { "" = "src" } - -[tool.setuptools.package-data] -"*" = ["*.pyi", "py.typed"] -[tool.setuptools.exclude-package-data] -"*" = ["*.py"] +[tool.hatch.build] +include = [ + "*.pyi", + "py.typed", +] +exclude = [ + "*.py", +] diff --git a/requirements.in b/requirements.in deleted file mode 100644 index 19f98337b6315cd16c954e2dbdd67a6cfbb8ccf1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 188 zcmZXO!47~R3`2W1@l*IB;{lZ*QP2oR{du)RZ(JB_`?fuIhaC Date: Fri, 14 Aug 2026 10:32:38 -0400 Subject: [PATCH 2/7] Updates build process and switches to uv. --- .github/workflows/ci.yml | 2 +- tests/test_generic.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/test_generic.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6cacae..3580d9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test Publish CwAPI3D Package +name: CI on: pull_request: diff --git a/tests/test_generic.py b/tests/test_generic.py new file mode 100644 index 0000000..0941146 --- /dev/null +++ b/tests/test_generic.py @@ -0,0 +1,2 @@ +def test_generic(): + assert True From 2bc1cb44a64c184b89318ef9c1de8920c8c4195f Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Paquet Date: Fri, 14 Aug 2026 10:44:41 -0400 Subject: [PATCH 3/7] Updates build process and switches to uv. --- .github/workflows/ci.yml | 2 +- pyproject.toml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3580d9a..7c5dbdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,5 +17,5 @@ jobs: - run: uv python install 3.14 - run: uv run pytest --cov --cov-branch --cov-report=xml - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - - run: uv run black --check . + - run: uv run ruff format --check - run: uv build diff --git a/pyproject.toml b/pyproject.toml index f64be90..232ea67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,12 @@ dev = [ "ruff>=0.16.3", ] +[tool.ruff] +line-length = 120 + +[tool.ruff.format] +quote-style = "single" + [build-system] requires = ["hatchling"] build-backend = "hatchling.build" From 53b62ab40f417045a3bb144624298c70dbf192f0 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Paquet Date: Fri, 14 Aug 2026 10:48:26 -0400 Subject: [PATCH 4/7] Fixes formatting. --- .../sync-cwapi3d-stubs/scripts/_config.py | 102 ++--- .../scripts/_cpp_bindings.py | 188 ++++---- .../sync-cwapi3d-stubs/scripts/_doxygen.py | 146 +++---- .../sync-cwapi3d-stubs/scripts/_emit.py | 325 +++++++------- .../sync-cwapi3d-stubs/scripts/_files.py | 20 +- .../sync-cwapi3d-stubs/scripts/_stubs.py | 51 +-- .../sync-cwapi3d-stubs/scripts/sync_stubs.py | 199 ++++----- docs/auto_attributes.md | 69 ++- docs/debug.md | 20 +- docs/examples/attribute_example.md | 63 ++- docs/examples/bim_example.md | 8 +- docs/examples/cadwork.md | 53 ++- docs/examples/compare.md | 29 +- docs/examples/connector_example.md | 16 +- docs/examples/element_example.md | 41 +- docs/examples/endtype_example.md | 15 +- docs/examples/file_example.md | 25 +- docs/examples/geometry.md | 19 +- docs/examples/geometry_example.md | 37 +- docs/examples/list_example.md | 13 +- docs/examples/machine_example.md | 12 +- docs/examples/material_example.md | 11 +- docs/examples/menu_example.md | 176 ++++---- docs/examples/scene_example.md | 6 +- docs/examples/shop_drawing_example.md | 13 +- docs/examples/tk_gui.md | 52 +-- docs/examples/utility_example.md | 21 +- docs/examples/visualization_example.md | 38 +- docs/modules.md | 27 +- src/attribute_controller/__init__.pyi | 209 +-------- src/bim_controller/__init__.pyi | 7 +- src/cadwork/__init__.pyi | 162 ++++--- src/cadwork/active_point_result.py | 2 +- src/cadwork/api_types.pyi | 20 +- src/cadwork/attribute_display_settings.pyi | 3 +- src/cadwork/bim_team_upload_result.pyi | 6 +- src/cadwork/bim_team_upload_result_code.pyi | 2 +- src/cadwork/btl_version.pyi | 3 +- src/cadwork/camera_data.pyi | 2 - src/cadwork/connector_axis_item.pyi | 1 - src/cadwork/coordinate_system_data.pyi | 2 - src/cadwork/dimension_base_format.pyi | 4 +- src/cadwork/division_zone_direction.pyi | 3 +- src/cadwork/double_shoulder_options.pyi | 2 - src/cadwork/dxf_export_version.pyi | 4 +- src/cadwork/dxf_layer_format_type.pyi | 4 +- src/cadwork/edge_list.pyi | 4 - src/cadwork/element_filter.pyi | 1 - src/cadwork/element_grouping_type.pyi | 3 +- src/cadwork/element_map_query.pyi | 1 - src/cadwork/element_module_detail.pyi | 3 +- src/cadwork/element_module_properties.pyi | 2 - src/cadwork/element_type.pyi | 2 - src/cadwork/end_type.pyi | 1 - src/cadwork/extended_settings.pyi | 25 +- src/cadwork/facet_list.pyi | 4 - src/cadwork/heel_shoulder_beam_geometry.pyi | 3 +- src/cadwork/heel_shoulder_options.pyi | 2 - src/cadwork/hit_result.pyi | 2 - src/cadwork/hundegger_machine_type.pyi | 3 +- src/cadwork/ifc_2x3_element_type.pyi | 4 +- src/cadwork/ifc_element_combine_behaviour.pyi | 3 +- src/cadwork/ifc_material_definition.pyi | 3 +- src/cadwork/ifc_options.pyi | 2 - src/cadwork/ifc_options_aggregation.pyi | 2 - src/cadwork/ifc_options_level_of_detail.pyi | 6 +- src/cadwork/ifc_options_project_data.pyi | 2 - src/cadwork/ifc_options_properties.pyi | 1 - src/cadwork/ifc_predefined_type.pyi | 2 - src/cadwork/import_3dc_options.pyi | 2 - src/cadwork/language.pyi | 2 +- src/cadwork/layer_settings.pyi | 2 - src/cadwork/multi_layer_cover_type.pyi | 3 +- src/cadwork/multi_layer_subtype.pyi | 5 +- src/cadwork/multi_layer_type.pyi | 3 +- src/cadwork/node_symbol.pyi | 3 +- src/cadwork/panel_prefab_element_data.pyi | 1 - src/cadwork/panel_prefab_element_settings.pyi | 1 - src/cadwork/panel_prefab_element_type.pyi | 2 +- src/cadwork/point_2d.pyi | 2 +- src/cadwork/polygon_list.pyi | 4 - src/cadwork/process_type.pyi | 2 - src/cadwork/projection_type.pyi | 3 +- src/cadwork/rhino_options.pyi | 2 - src/cadwork/shortcut_key.pyi | 3 +- src/cadwork/shortcut_key_modifier.pyi | 3 +- src/cadwork/shoulder_beam_geometry.pyi | 2 - src/cadwork/shoulder_drilling_orientation.pyi | 3 +- src/cadwork/shoulder_options.pyi | 2 - src/cadwork/standard_element_type.pyi | 3 +- src/cadwork/text_element_type.pyi | 3 +- src/cadwork/text_object_options.pyi | 1 - src/cadwork/vba_catalog_item_type.pyi | 4 +- src/cadwork/vertex_list.pyi | 4 - src/cadwork/weinmann_mfb_version.pyi | 3 +- src/cadwork/window_geometry.pyi | 3 +- src/cadwork/working_plane_exit_view.pyi | 2 +- src/connector_axis_controller/__init__.pyi | 73 +--- src/dimension_controller/__init__.pyi | 37 +- src/element_controller/__init__.pyi | 400 +++++++++++++----- src/endtype_controller/__init__.pyi | 3 - src/file_controller/__init__.pyi | 112 +++-- src/geometry_controller/__init__.pyi | 4 +- src/list_controller/__init__.pyi | 17 +- src/machine_controller/__init__.pyi | 21 +- src/material_controller/__init__.pyi | 40 +- src/menu_controller/__init__.pyi | 2 - src/multi_layer_cover_controller/__init__.pyi | 9 +- src/roof_controller/__init__.pyi | 8 +- src/scene_controller/__init__.pyi | 3 +- src/shop_drawing_controller/__init__.pyi | 10 +- src/utility_controller/__init__.pyi | 194 ++------- src/visualization_controller/__init__.pyi | 76 ++-- 113 files changed, 1450 insertions(+), 1944 deletions(-) diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/_config.py b/.claude/skills/sync-cwapi3d-stubs/scripts/_config.py index 6426bc7..d7559d5 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/_config.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/_config.py @@ -22,8 +22,8 @@ from pathlib import Path from typing import Any -CONFIG_FILENAME = "config.toml" -PERSONAL_CONFIG_FILENAME = "config.personal.toml" +CONFIG_FILENAME = 'config.toml' +PERSONAL_CONFIG_FILENAME = 'config.personal.toml' _SKILL_DIR = Path(__file__).resolve().parent.parent @@ -45,7 +45,7 @@ def _find(filename: str, env_var: str) -> Path | None: if override: path = Path(override) if not path.is_file(): - raise ConfigError(f"{env_var} points at a missing file: {path}") + raise ConfigError(f'{env_var} points at a missing file: {path}') return path # The skill dir is checked first: it is where the pair actually lives. beside_skill = _SKILL_DIR / filename @@ -73,14 +73,14 @@ def _deep_merge(base: dict[str, Any], override: dict[str, Any]) -> dict[str, Any def _read_toml(path: Path) -> dict[str, Any]: try: - return tomllib.loads(path.read_text(encoding="utf-8")) + return tomllib.loads(path.read_text(encoding='utf-8')) except (tomllib.TOMLDecodeError, UnicodeDecodeError) as error: - raise ConfigError(f"{path}: {error}") from error + raise ConfigError(f'{path}: {error}') from error def _git_root(start: Path) -> Path | None: for directory in (start, *start.parents): - if (directory / ".git").exists(): + if (directory / '.git').exists(): return directory return None @@ -114,117 +114,103 @@ def section(self, name: str) -> dict[str, Any]: @property def blacklist_modules(self) -> set[str]: - return set(self.section("blacklist").get("modules", [])) + return set(self.section('blacklist').get('modules', [])) @property def blacklist_methods(self) -> set[str]: - return set(self.section("blacklist").get("methods", [])) + return set(self.section('blacklist').get('methods', [])) @property def blacklist_qualified(self) -> set[str]: - return set(self.section("blacklist").get("qualified", [])) + return set(self.section('blacklist').get('qualified', [])) @property def blacklist_types(self) -> set[str]: - return set(self.section("blacklist").get("types", [])) + return set(self.section('blacklist').get('types', [])) @property def blacklist_class_method_patterns(self) -> list[str]: - return list(self.section("blacklist").get("class_method_patterns", [])) + return list(self.section('blacklist').get('class_method_patterns', [])) @property def type_map(self) -> dict[str, str]: - return dict(self.section("type_map")) + return dict(self.section('type_map')) @property def param_names(self) -> dict[str, str]: - return dict(self.section("param_names")) + return dict(self.section('param_names')) @property def hint_map(self) -> dict[str, str]: - return dict(self.section("doxygen_hint_map")) + return dict(self.section('doxygen_hint_map')) @property def enums_page(self) -> str: - return str(self.section("emit").get("enums_page", "enums.md")) + return str(self.section('emit').get('enums_page', 'enums.md')) @property def bump_version(self) -> bool: - return bool(self.section("emit").get("bump_version", True)) + return bool(self.section('emit').get('bump_version', True)) def load() -> Config: - config_path = _find(CONFIG_FILENAME, "CWSTUBS_CONFIG") + config_path = _find(CONFIG_FILENAME, 'CWSTUBS_CONFIG') if config_path is None: - raise ConfigError( - f"no {CONFIG_FILENAME} found beside the skill or above {Path.cwd()}" - ) + raise ConfigError(f'no {CONFIG_FILENAME} found beside the skill or above {Path.cwd()}') raw = _read_toml(config_path) personal_path: Path | None = None - if not os.environ.get("CWSTUBS_CONFIG"): - personal_path = _find(PERSONAL_CONFIG_FILENAME, "CWSTUBS_PERSONAL_CONFIG") + if not os.environ.get('CWSTUBS_CONFIG'): + personal_path = _find(PERSONAL_CONFIG_FILENAME, 'CWSTUBS_PERSONAL_CONFIG') if personal_path is not None: raw = _deep_merge(raw, _read_toml(personal_path)) - paths = raw.get("paths", {}) - cadlib_raw = paths.get("cadlib_root") + paths = raw.get('paths', {}) + cadlib_raw = paths.get('cadlib_root') if not cadlib_raw: raise ConfigError( - "[paths].cadlib_root is not set. Copy " - f"{PERSONAL_CONFIG_FILENAME}.example to {PERSONAL_CONFIG_FILENAME} " - f"in {_SKILL_DIR} and set it." + '[paths].cadlib_root is not set. Copy ' + f'{PERSONAL_CONFIG_FILENAME}.example to {PERSONAL_CONFIG_FILENAME} ' + f'in {_SKILL_DIR} and set it.' ) cadlib_root = Path(cadlib_raw).resolve() if not cadlib_root.is_dir(): - raise ConfigError(f"[paths].cadlib_root does not exist: {cadlib_root}") + raise ConfigError(f'[paths].cadlib_root does not exist: {cadlib_root}') - stub_raw = paths.get("stub_repo") + stub_raw = paths.get('stub_repo') if stub_raw: stub_repo = Path(stub_raw).resolve() else: discovered = _git_root(config_path.resolve().parent) if discovered is None: - raise ConfigError( - "[paths].stub_repo is unset and no git root was found above " - f"{config_path}" - ) + raise ConfigError(f'[paths].stub_repo is unset and no git root was found above {config_path}') stub_repo = discovered if not stub_repo.is_dir(): - raise ConfigError(f"[paths].stub_repo does not exist: {stub_repo}") + raise ConfigError(f'[paths].stub_repo does not exist: {stub_repo}') - source = raw.get("source", {}) - target = raw.get("target", {}) + source = raw.get('source', {}) + target = raw.get('target', {}) - python_controller = cadlib_root / source.get( - "python_controller", "CwAPI3D/CCwAPI3DPythonController.cpp" - ) - interface_include_dir = cadlib_root / source.get( - "interface_include_dir", "CwAPI3D/include" - ) - version_header = cadlib_root / source.get( - "version_header", "CwAPI3D/include/CwAPI3DVersion.h" - ) + python_controller = cadlib_root / source.get('python_controller', 'CwAPI3D/CCwAPI3DPythonController.cpp') + interface_include_dir = cadlib_root / source.get('interface_include_dir', 'CwAPI3D/include') + version_header = cadlib_root / source.get('version_header', 'CwAPI3D/include/CwAPI3DVersion.h') if not python_controller.is_file(): - raise ConfigError(f"binding source not found: {python_controller}") + raise ConfigError(f'binding source not found: {python_controller}') if not interface_include_dir.is_dir(): - raise ConfigError(f"interface include dir not found: {interface_include_dir}") + raise ConfigError(f'interface include dir not found: {interface_include_dir}') # The package version is derived from this header, so a wrong path is a config # error rather than something to discover halfway through --apply. if not version_header.is_file(): - raise ConfigError(f"version header not found: {version_header}") + raise ConfigError(f'version header not found: {version_header}') - configured_enum_dirs = source.get("enum_search_dirs") + configured_enum_dirs = source.get('enum_search_dirs') if configured_enum_dirs: enum_dirs = tuple(cadlib_root / entry for entry in configured_enum_dirs) else: enum_dirs = (interface_include_dir, interface_include_dir.parent) missing_enum_dirs = [str(path) for path in enum_dirs if not path.is_dir()] if missing_enum_dirs: - raise ConfigError( - "[source].enum_search_dirs entries do not exist: " - + ", ".join(missing_enum_dirs) - ) + raise ConfigError('[source].enum_search_dirs entries do not exist: ' + ', '.join(missing_enum_dirs)) return Config( raw=raw, @@ -236,9 +222,9 @@ def load() -> Config: interface_include_dir=interface_include_dir, version_header=version_header, enum_search_dirs=enum_dirs, - src_dir=stub_repo / target.get("src_dir", "src"), - docs_dir=stub_repo / target.get("docs_dir", "docs/documentation"), - mkdocs=stub_repo / target.get("mkdocs", "mkdocs.yml"), - pyproject=stub_repo / target.get("pyproject", "pyproject.toml"), - compare_branch=str(target.get("compare_branch", "main")), + src_dir=stub_repo / target.get('src_dir', 'src'), + docs_dir=stub_repo / target.get('docs_dir', 'docs/documentation'), + mkdocs=stub_repo / target.get('mkdocs', 'mkdocs.yml'), + pyproject=stub_repo / target.get('pyproject', 'pyproject.toml'), + compare_branch=str(target.get('compare_branch', 'main')), ) diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/_cpp_bindings.py b/.claude/skills/sync-cwapi3d-stubs/scripts/_cpp_bindings.py index e4edda4..f7d3120 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/_cpp_bindings.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/_cpp_bindings.py @@ -21,19 +21,19 @@ from dataclasses import dataclass, field from pathlib import Path -_MODULE_RE = re.compile(r"^PYBIND11_EMBEDDED_MODULE\(\s*(\w+)\s*,\s*\w+\s*\)", re.M) -_TRAMPOLINE_START_RE = re.compile(r"^([A-Za-z_][\w:<>,*&\s]*?)\s+(cwp_\w+)\s*\(", re.M) -_FORWARD_RE = re.compile(r"getFactory\(\)\s*->\s*(\w+)\(\)\s*->\s*(\w+)\s*\(") +_MODULE_RE = re.compile(r'^PYBIND11_EMBEDDED_MODULE\(\s*(\w+)\s*,\s*\w+\s*\)', re.M) +_TRAMPOLINE_START_RE = re.compile(r'^([A-Za-z_][\w:<>,*&\s]*?)\s+(cwp_\w+)\s*\(', re.M) +_FORWARD_RE = re.compile(r'getFactory\(\)\s*->\s*(\w+)\(\)\s*->\s*(\w+)\s*\(') # Some trampolines cache the controller in a local first: # auto* lController = ...getFactory()->getElementController(); # const auto lResult = lController->getElementActivePoint(a0); -_ACCESSOR_RE = re.compile(r"getFactory\(\)\s*->\s*(get\w+Controller)\(\)") -_LOCAL_CALL_RE = re.compile(r"\bl[A-Z]\w*\s*->\s*(\w+)\s*\(") -_STATIC_CAST_RE = re.compile(r"static_cast\s*<\s*([\w:]+)\s*>\s*\(\s*(\w+)\s*\)") -_CLASS_RE = re.compile(r"py::class_\s*<") -_ENUM_RE = re.compile(r"py::enum_\s*<") +_ACCESSOR_RE = re.compile(r'getFactory\(\)\s*->\s*(get\w+Controller)\(\)') +_LOCAL_CALL_RE = re.compile(r'\bl[A-Z]\w*\s*->\s*(\w+)\s*\(') +_STATIC_CAST_RE = re.compile(r'static_cast\s*<\s*([\w:]+)\s*>\s*\(\s*(\w+)\s*\)') +_CLASS_RE = re.compile(r'py::class_\s*<') +_ENUM_RE = re.compile(r'py::enum_\s*<') _ATTR_ALIAS_RE = re.compile(r'^\s*m\.attr\("(\w+)"\)\s*=\s*(\w+)\s*;', re.M) -_ENUM_VAR_RE = re.compile(r"^\s*auto\s+(\w+)\s*=\s*$|^\s*auto\s+(\w+)\s*=\s*py::enum_") +_ENUM_VAR_RE = re.compile(r'^\s*auto\s+(\w+)\s*=\s*$|^\s*auto\s+(\w+)\s*=\s*py::enum_') @dataclass(frozen=True) @@ -105,7 +105,7 @@ def _skip_string(text: str, index: int) -> int: quote = text[index] index += 1 while index < len(text): - if text[index] == "\\": + if text[index] == '\\': index += 2 continue if text[index] == quote: @@ -120,20 +120,20 @@ def _match_parens(text: str, open_index: int) -> int: index = open_index while index < len(text): char = text[index] - if char in "\"'": + if char in '"\'': index = _skip_string(text, index) continue - if char == "(": + if char == '(': depth += 1 - elif char == ")": + elif char == ')': depth -= 1 if depth == 0: return index index += 1 - raise ValueError(f"unbalanced parentheses from offset {open_index}") + raise ValueError(f'unbalanced parentheses from offset {open_index}') -def _split_top_level(text: str, separator: str = ",") -> list[str]: +def _split_top_level(text: str, separator: str = ',') -> list[str]: """Split on `separator` at nesting depth 0 of ``()``, ``<>``, ``[]``, ``{}``.""" parts: list[str] = [] depth = 0 @@ -141,23 +141,23 @@ def _split_top_level(text: str, separator: str = ",") -> list[str]: index = 0 while index < len(text): char = text[index] - if char in "\"'": + if char in '"\'': end = _skip_string(text, index) current.append(text[index:end]) index = end continue - if char in "(<[{": + if char in '(<[{': depth += 1 - elif char in ")>]}": + elif char in ')>]}': depth -= 1 elif char == separator and depth == 0: - parts.append("".join(current).strip()) + parts.append(''.join(current).strip()) current = [] index += 1 continue current.append(char) index += 1 - tail = "".join(current).strip() + tail = ''.join(current).strip() if tail: parts.append(tail) return parts @@ -166,26 +166,26 @@ def _split_top_level(text: str, separator: str = ",") -> list[str]: def _normalize_type(raw: str) -> str: """Strip cv/ref decoration and collapse whitespace on a C++ type.""" text = raw.strip() - text = re.sub(r"\bconst\b", " ", text) - text = text.replace("&", " ") - text = re.sub(r"\s*([<>,*])\s*", r"\1", text) - text = re.sub(r",", ", ", text) - text = re.sub(r"\s+", " ", text).strip() + text = re.sub(r'\bconst\b', ' ', text) + text = text.replace('&', ' ') + text = re.sub(r'\s*([<>,*])\s*', r'\1', text) + text = re.sub(r',', ', ', text) + text = re.sub(r'\s+', ' ', text).strip() return text def _split_param(raw: str) -> tuple[str, str]: """Split one C++ parameter declaration into (type, name).""" text = raw.strip() - if not text or text == "void": - return ("", "") - text = text.split("=", 1)[0].strip() - match = re.search(r"(\w+)\s*$", text) - if match and not re.fullmatch(r"[\w:]+", text): + if not text or text == 'void': + return ('', '') + text = text.split('=', 1)[0].strip() + match = re.search(r'(\w+)\s*$', text) + if match and not re.fullmatch(r'[\w:]+', text): name = match.group(1) type_part = text[: match.start(1)] return (_normalize_type(type_part), name) - return (_normalize_type(text), "") + return (_normalize_type(text), '') # --------------------------------------------------------------------------- @@ -205,7 +205,7 @@ def _parse_trampolines(text: str) -> dict[str, Trampoline]: continue # A declaration ends in ';', a definition in '{'. Only definitions carry a body. tail = text[close_index + 1 : close_index + 200].lstrip() - if not tail.startswith("{"): + if not tail.startswith('{'): continue params_raw = text[open_index + 1 : close_index] types: list[str] = [] @@ -217,8 +217,8 @@ def _parse_trampolines(text: str) -> dict[str, Trampoline]: types.append(param_type) names.append(param_name) - body_start = text.index("{", close_index) - body_end = text.find("\n}", body_start) + body_start = text.index('{', close_index) + body_end = text.find('\n}', body_start) body = text[body_start : body_end if body_end != -1 else body_start + 4000] forward = _FORWARD_RE.search(body) if forward is not None: @@ -230,9 +230,7 @@ def _parse_trampolines(text: str) -> dict[str, Trampoline]: accessor = accessor_match.group(1) if accessor_match else None cpp_method = local_match.group(1) if local_match else None - casts = { - cast.group(2): cast.group(1) for cast in _STATIC_CAST_RE.finditer(body) - } + casts = {cast.group(2): cast.group(1) for cast in _STATIC_CAST_RE.finditer(body)} result[symbol] = Trampoline( symbol=symbol, return_type=return_type, @@ -255,17 +253,17 @@ def _module_spans(text: str) -> list[tuple[str, int, int]]: spans: list[tuple[str, int, int]] = [] for match in _MODULE_RE.finditer(text): name = match.group(1) - brace = text.index("{", match.end()) + brace = text.index('{', match.end()) # Inner braces are always indented in this file; the body terminator is the # first '}' at column 0 after the opening brace. - end = text.find("\n}", brace) + end = text.find('\n}', brace) end = len(text) if end == -1 else end + 1 spans.append((name, brace, end)) return spans def _parse_def_call(module: str, body: str, offset: int, base_line: int) -> Binding | None: - open_index = body.index("(", offset) + open_index = body.index('(', offset) close_index = _match_parens(body, open_index) inner = body[open_index + 1 : close_index] parts = _split_top_level(inner) @@ -280,15 +278,15 @@ def _parse_def_call(module: str, body: str, offset: int, base_line: int) -> Bind is_lambda = False if len(parts) > 1: target = parts[1].strip() - if target.startswith("[") or "->" in target[:3]: + if target.startswith('[') or '->' in target[:3]: is_lambda = True - inner_call = re.search(r"\b(cwp_\w+)\s*\(", target) + inner_call = re.search(r'\b(cwp_\w+)\s*\(', target) if inner_call: symbol = inner_call.group(1) else: - symbol_match = re.match(r"^&?\s*([\w:]+)\s*$", target) + symbol_match = re.match(r'^&?\s*([\w:]+)\s*$', target) if symbol_match: - symbol = symbol_match.group(1).split("::")[-1] + symbol = symbol_match.group(1).split('::')[-1] arg_names: list[str] = [] arg_defaults: list[str | None] = [] @@ -299,7 +297,7 @@ def _parse_def_call(module: str, body: str, offset: int, base_line: int) -> Bind default = arg_match.group(2) arg_defaults.append(default.strip() if default else None) - line = base_line + body.count("\n", 0, offset) + line = base_line + body.count('\n', 0, offset) return Binding( module=module, python_name=python_name, @@ -315,8 +313,8 @@ def _parse_bindings(text: str, spans: list[tuple[str, int, int]]) -> list[Bindin bindings: list[Binding] = [] for module, start, end in spans: body = text[start:end] - base_line = text.count("\n", 0, start) + 1 - for match in re.finditer(r"\bm\.def\s*\(", body): + base_line = text.count('\n', 0, start) + 1 + for match in re.finditer(r'\bm\.def\s*\(', body): try: binding = _parse_def_call(module, body, match.start(), base_line) except ValueError: @@ -337,14 +335,14 @@ def _chain_end(text: str, start: int) -> int: index = start while index < len(text): char = text[index] - if char in "\"'": + if char in '"\'': index = _skip_string(text, index) continue - if char in "([{": + if char in '([{': depth += 1 - elif char in ")]}": + elif char in ')]}': depth -= 1 - elif char == ";" and depth <= 0: + elif char == ';' and depth <= 0: return index index += 1 return len(text) @@ -354,32 +352,32 @@ def _template_arg(text: str, open_angle: int) -> tuple[str, int]: depth = 0 index = open_angle while index < len(text): - if text[index] == "<": + if text[index] == '<': depth += 1 - elif text[index] == ">": + elif text[index] == '>': depth -= 1 if depth == 0: return (text[open_angle + 1 : index], index) index += 1 - raise ValueError("unbalanced template brackets") + raise ValueError('unbalanced template brackets') def _parse_types(text: str, span: tuple[str, int, int]) -> list[CadworkType]: _, start, end = span body = text[start:end] - base_line = text.count("\n", 0, start) + 1 + base_line = text.count('\n', 0, start) + 1 types: list[CadworkType] = [] by_variable: dict[str, CadworkType] = {} - for kind, pattern in (("class", _CLASS_RE), ("enum", _ENUM_RE)): + for kind, pattern in (('class', _CLASS_RE), ('enum', _ENUM_RE)): for match in pattern.finditer(body): - angle = body.index("<", match.start()) + angle = body.index('<', match.start()) try: template_args, close_angle = _template_arg(body, angle) except ValueError: continue cpp_type = _split_top_level(template_args)[0].strip() - paren = body.index("(", close_angle) + paren = body.index('(', close_angle) call_end = _match_parens(body, paren) call_args = _split_top_level(body[paren + 1 : call_end]) if len(call_args) < 2: @@ -391,16 +389,16 @@ def _parse_types(text: str, span: tuple[str, int, int]) -> list[CadworkType]: python_name=name_match.group(1), cpp_type=cpp_type, kind=kind, - line=base_line + body.count("\n", 0, match.start()), + line=base_line + body.count('\n', 0, match.start()), ) chain = body[call_end : _chain_end(body, call_end)] _fill_chain(entry, chain) types.append(entry) # `auto = py::enum_<...>` -- remember for m.attr alias resolution. - line_start = body.rfind("\n", 0, match.start()) + 1 + line_start = body.rfind('\n', 0, match.start()) + 1 prefix = body[line_start : match.start()] - var_match = re.search(r"\bauto\s+(\w+)\s*=\s*$", prefix) + var_match = re.search(r'\bauto\s+(\w+)\s*=\s*$', prefix) if var_match: by_variable[var_match.group(1)] = entry @@ -415,8 +413,8 @@ def _parse_types(text: str, span: tuple[str, int, int]) -> list[CadworkType]: def _fill_chain(entry: CadworkType, chain: str) -> None: - for match in re.finditer(r"\.def_(readwrite|readonly)\s*\(", chain): - open_index = chain.index("(", match.start()) + for match in re.finditer(r'\.def_(readwrite|readonly)\s*\(', chain): + open_index = chain.index('(', match.start()) args = _split_top_level(chain[open_index + 1 : _match_parens(chain, open_index)]) if len(args) >= 2: name_match = re.match(r'^"([^"]+)"$', args[0].strip()) @@ -424,41 +422,35 @@ def _fill_chain(entry: CadworkType, chain: str) -> None: entry.fields.append( ( name_match.group(1), - args[1].strip().lstrip("&"), - match.group(1) == "readwrite", + args[1].strip().lstrip('&'), + match.group(1) == 'readwrite', ) ) - for match in re.finditer(r"\.def\s*\(", chain): - open_index = chain.index("(", match.start()) + for match in re.finditer(r'\.def\s*\(', chain): + open_index = chain.index('(', match.start()) try: - args = _split_top_level( - chain[open_index + 1 : _match_parens(chain, open_index)] - ) + args = _split_top_level(chain[open_index + 1 : _match_parens(chain, open_index)]) except ValueError: continue if not args: continue first = args[0].strip() - if first.startswith("py::init"): - init_angle = first.find("<") + if first.startswith('py::init'): + init_angle = first.find('<') if init_angle != -1: try: template_args, _ = _template_arg(first, init_angle) except ValueError: continue entry.init_signatures.append( - tuple( - _normalize_type(part) - for part in _split_top_level(template_args) - if part.strip() - ) + tuple(_normalize_type(part) for part in _split_top_level(template_args) if part.strip()) ) continue name_match = re.match(r'^"([^"]+)"$', first) if name_match is None: continue - member = args[1].strip().lstrip("&") if len(args) > 1 else "" + member = args[1].strip().lstrip('&') if len(args) > 1 else '' entry.methods.append((name_match.group(1), member)) for match in re.finditer(r'\.value\s*\(\s*"(\w+)"\s*,\s*([\w:]+)', chain): @@ -469,9 +461,7 @@ def _fill_chain(entry: CadworkType, chain: str) -> None: # C++ enum definitions -- the real numeric values and their trailing ///< docs # --------------------------------------------------------------------------- -_ENUM_DEF_RE = re.compile( - r"\benum\s+(?:class\s+|struct\s+)?(\w+)\s*(?::\s*[\w:]+\s*)?\{", re.M -) +_ENUM_DEF_RE = re.compile(r'\benum\s+(?:class\s+|struct\s+)?(\w+)\s*(?::\s*[\w:]+\s*)?\{', re.M) @dataclass(frozen=True) @@ -494,15 +484,13 @@ def parse_enum_definitions(search_dirs: list[Path]) -> dict[str, list[EnumMember ICwAPI3DEventObserver.h. """ result: dict[str, list[EnumMember]] = {} - headers = sorted( - {header for directory in search_dirs for header in directory.glob("*.h")} - ) + headers = sorted({header for directory in search_dirs for header in directory.glob('*.h')}) for header in headers: - text = header.read_text(encoding="utf-8", errors="replace") + text = header.read_text(encoding='utf-8', errors='replace') for match in _ENUM_DEF_RE.finditer(text): name = match.group(1) - brace = text.index("{", match.start()) - close = text.find("};", brace) + brace = text.index('{', match.start()) + close = text.find('};', brace) if close == -1: continue members: list[EnumMember] = [] @@ -511,30 +499,30 @@ def parse_enum_definitions(search_dirs: list[Path]) -> dict[str, list[EnumMember failed = False for raw_line in text[brace + 1 : close].splitlines(): line = raw_line.strip() - doc = "" - doc_match = re.search(r"///<\s*(.*)$", line) + doc = '' + doc_match = re.search(r'///<\s*(.*)$', line) if doc_match: doc = doc_match.group(1).strip() line = line[: doc_match.start()].strip() - line = re.sub(r"//.*$", "", line).strip().rstrip(",").strip() - if not line or line.startswith("/"): + line = re.sub(r'//.*$', '', line).strip().rstrip(',').strip() + if not line or line.startswith('/'): continue - if "=" in line: - member, _, expression = line.partition("=") + if '=' in line: + member, _, expression = line.partition('=') member = member.strip() expression = expression.strip() - if re.fullmatch(r"-?0[xX][0-9a-fA-F]+", expression): + if re.fullmatch(r'-?0[xX][0-9a-fA-F]+', expression): counter = int(expression, 16) - elif re.fullmatch(r"-?\d+", expression): + elif re.fullmatch(r'-?\d+', expression): counter = int(expression) - elif expression.split("::")[-1] in by_name: - counter = by_name[expression.split("::")[-1]] + elif expression.split('::')[-1] in by_name: + counter = by_name[expression.split('::')[-1]] else: failed = True break else: member = line - if not re.fullmatch(r"\w+", member): + if not re.fullmatch(r'\w+', member): failed = True break members.append(EnumMember(name=member, value=counter, doc=doc)) @@ -551,9 +539,9 @@ def parse_enum_definitions(search_dirs: list[Path]) -> dict[str, list[EnumMember def parse(path: Path) -> Inventory: - text = path.read_text(encoding="utf-8", errors="replace") + text = path.read_text(encoding='utf-8', errors='replace') spans = _module_spans(text) - cadwork_span = next((span for span in spans if span[0] == "cadwork"), None) + cadwork_span = next((span for span in spans if span[0] == 'cadwork'), None) return Inventory( trampolines=_parse_trampolines(text), bindings=_parse_bindings(text, spans), diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/_doxygen.py b/.claude/skills/sync-cwapi3d-stubs/scripts/_doxygen.py index 9406d18..7415802 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/_doxygen.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/_doxygen.py @@ -17,31 +17,27 @@ from pathlib import Path _VIRTUAL_RE = re.compile( - r"^\s*virtual\s+(?P[\w:<>,*&\s]+?)\s+(?P\w+)\s*\((?P[^;]*?)\)\s*" - r"(?:const\s*)?=\s*0\s*;", + r'^\s*virtual\s+(?P[\w:<>,*&\s]+?)\s+(?P\w+)\s*\((?P[^;]*?)\)\s*' + r'(?:const\s*)?=\s*0\s*;', re.M, ) -_PARAM_RE = re.compile( - r"@param\s*(?:\[[^\]]*\])?\s*(?P\w+)\s*(?:\[(?P[^\]]*)\])?\s*(?P.*)" -) -_RETURN_RE = re.compile( - r"@(?:return|result)s?\s*(?:\[(?P[^\]]*)\])?\s*(?P.*)" -) -_REF_RE = re.compile(r"@ref\s+") +_PARAM_RE = re.compile(r'@param\s*(?:\[[^\]]*\])?\s*(?P\w+)\s*(?:\[(?P[^\]]*)\])?\s*(?P.*)') +_RETURN_RE = re.compile(r'@(?:return|result)s?\s*(?:\[(?P[^\]]*)\])?\s*(?P.*)') +_REF_RE = re.compile(r'@ref\s+') @dataclass class DocBlock: interface: str method: str - brief: str = "" + brief: str = '' # (name, doxygen type hint, description) params: list[tuple[str, str, str]] = field(default_factory=list) - returns: str = "" - returns_hint: str = "" - note: str = "" + returns: str = '' + returns_hint: str = '' + note: str = '' example: list[str] = field(default_factory=list) - deprecated: str = "" + deprecated: str = '' @property def is_thin(self) -> bool: @@ -51,17 +47,17 @@ def is_thin(self) -> bool: def camel_to_snake(name: str) -> str: """``aElementIDList`` -> ``element_id_list``; ``aP1`` -> ``p1``.""" text = name - if re.match(r"^a[A-Z0-9]", text): + if re.match(r'^a[A-Z0-9]', text): text = text[1:] - text = re.sub(r"(.)([A-Z][a-z]+)", r"\1_\2", text) - text = re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", text) - return text.lower().strip("_") + text = re.sub(r'(.)([A-Z][a-z]+)', r'\1_\2', text) + text = re.sub(r'([a-z0-9])([A-Z])', r'\1_\2', text) + return text.lower().strip('_') def _clean(text: str) -> str: - text = _REF_RE.sub("", text) - text = text.replace("@li", "-") - return re.sub(r"\s+", " ", text).strip() + text = _REF_RE.sub('', text) + text = text.replace('@li', '-') + return re.sub(r'\s+', ' ', text).strip() def _comment_lines_above(lines: list[str], index: int) -> list[str]: @@ -70,16 +66,16 @@ def _comment_lines_above(lines: list[str], index: int) -> list[str]: cursor = index - 1 while cursor >= 0: stripped = lines[cursor].strip() - if stripped.startswith("///"): + if stripped.startswith('///'): collected.append(stripped[3:].strip()) cursor -= 1 continue - if stripped.endswith("*/"): + if stripped.endswith('*/'): block: list[str] = [] while cursor >= 0: inner = lines[cursor].strip() - block.append(inner.removesuffix("*/").removeprefix("/**").lstrip("*").strip()) - if inner.startswith("/*"): + block.append(inner.removesuffix('*/').removeprefix('/**').lstrip('*').strip()) + if inner.startswith('/*'): break cursor -= 1 collected.extend(block) @@ -98,9 +94,9 @@ def _normalize(raw_lines: list[str]) -> list[str]: """ normalized: list[str] = [] for line in raw_lines: - line = _REF_RE.sub("", line) - line = re.sub(r"^@li\b\s*", "- ", line) - line = line.replace("@li", "-") + line = _REF_RE.sub('', line) + line = re.sub(r'^@li\b\s*', '- ', line) + line = line.replace('@li', '-') normalized.append(line.strip()) return normalized @@ -108,91 +104,91 @@ def _normalize(raw_lines: list[str]) -> list[str]: def _parse_block(interface: str, method: str, raw_lines: list[str]) -> DocBlock: block = DocBlock(interface=interface, method=method) raw_lines = _normalize(raw_lines) - mode = "" + mode = '' buffer: list[str] = [] def flush() -> None: nonlocal buffer - text = _clean(" ".join(buffer)) + text = _clean(' '.join(buffer)) if text: - if mode == "brief" and not block.brief: + if mode == 'brief' and not block.brief: block.brief = text - elif mode == "note": - block.note = (block.note + " " + text).strip() - elif mode == "deprecated": - block.deprecated = (block.deprecated + " " + text).strip() + elif mode == 'note': + block.note = (block.note + ' ' + text).strip() + elif mode == 'deprecated': + block.deprecated = (block.deprecated + ' ' + text).strip() buffer = [] for line in raw_lines: - if line.startswith("@code"): - mode = "code" + if line.startswith('@code'): + mode = 'code' continue - if line.startswith("@endcode"): - mode = "" + if line.startswith('@endcode'): + mode = '' continue - if mode == "code": + if mode == 'code': block.example.append(line) continue - if line.startswith("@brief"): + if line.startswith('@brief'): flush() - mode = "brief" - buffer = [line[len("@brief") :]] + mode = 'brief' + buffer = [line[len('@brief') :]] continue - if line.startswith("@param"): + if line.startswith('@param'): flush() - mode = "param" + mode = 'param' match = _PARAM_RE.match(line) if match: block.params.append( ( - match.group("name"), - _clean(match.group("type") or ""), - _clean(match.group("desc") or ""), + match.group('name'), + _clean(match.group('type') or ''), + _clean(match.group('desc') or ''), ) ) continue - if re.match(r"@(return|result)", line): + if re.match(r'@(return|result)', line): flush() - mode = "return" + mode = 'return' match = _RETURN_RE.match(line) if match: - block.returns = _clean(match.group("desc") or "") - block.returns_hint = _clean(match.group("type") or "") + block.returns = _clean(match.group('desc') or '') + block.returns_hint = _clean(match.group('type') or '') continue - if line.startswith("@note"): + if line.startswith('@note'): flush() - mode = "note" - buffer = [line[len("@note") :]] + mode = 'note' + buffer = [line[len('@note') :]] continue - if line.startswith("@deprecated"): + if line.startswith('@deprecated'): flush() - mode = "deprecated" - buffer = [line[len("@deprecated") :]] + mode = 'deprecated' + buffer = [line[len('@deprecated') :]] continue - if line.startswith("@par"): + if line.startswith('@par'): flush() - mode = "" + mode = '' continue - if line.startswith("@"): + if line.startswith('@'): # @since / @author / @date / @ingroup / @interface -- not docstring material. flush() - mode = "" + mode = '' continue if not line: flush() continue - if mode == "param" and block.params: + if mode == 'param' and block.params: name, hint, desc = block.params[-1] - block.params[-1] = (name, hint, _clean(f"{desc} {line}")) + block.params[-1] = (name, hint, _clean(f'{desc} {line}')) continue - if mode == "return": - block.returns = _clean(f"{block.returns} {line}") + if mode == 'return': + block.returns = _clean(f'{block.returns} {line}') continue - if mode in ("brief", "note", "deprecated"): + if mode in ('brief', 'note', 'deprecated'): buffer.append(line) continue if not block.brief: - mode = "brief" + mode = 'brief' buffer = [line] flush() @@ -208,7 +204,7 @@ def lookup(self, accessor: str | None, method: str | None) -> DocBlock | None: if not method: return None if accessor: - interface = "ICwAPI3D" + accessor.removeprefix("get") + interface = 'ICwAPI3D' + accessor.removeprefix('get') found = self.by_interface.get((interface, method)) if found is not None: return found @@ -222,16 +218,14 @@ def parse(include_dir: Path) -> DoxygenIndex: by_interface: dict[tuple[str, str], DocBlock] = {} by_method: dict[str, list[DocBlock]] = {} - for header in sorted(include_dir.glob("ICwAPI3D*.h")): + for header in sorted(include_dir.glob('ICwAPI3D*.h')): interface = header.stem - text = header.read_text(encoding="utf-8", errors="replace") + text = header.read_text(encoding='utf-8', errors='replace') lines = text.splitlines() for match in _VIRTUAL_RE.finditer(text): - method = match.group("name") - line_index = text.count("\n", 0, match.start()) - block = _parse_block( - interface, method, _comment_lines_above(lines, line_index) - ) + method = match.group('name') + line_index = text.count('\n', 0, match.start()) + block = _parse_block(interface, method, _comment_lines_above(lines, line_index)) key = (interface, method) # Overloads share a name; keep the first (richest) documented one. if key not in by_interface or by_interface[key].is_thin: diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/_emit.py b/.claude/skills/sync-cwapi3d-stubs/scripts/_emit.py index a6f48f9..d9da156 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/_emit.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/_emit.py @@ -26,18 +26,18 @@ from _cpp_bindings import Binding, CadworkType, EnumMember, Trampoline from _doxygen import DocBlock, camel_to_snake -_INDENT = " " +_INDENT = ' ' _API_TYPE_ALIASES = { - "ElementId", - "MaterialId", - "ColorId", - "EndtypeId", - "AxisId", - "MenuIndex", - "ReferenceSide", - "MultiLayerSetId", - "UserAttributeId", - "UnsignedInt", + 'ElementId', + 'MaterialId', + 'ColorId', + 'EndtypeId', + 'AxisId', + 'MenuIndex', + 'ReferenceSide', + 'MultiLayerSetId', + 'UserAttributeId', + 'UnsignedInt', } @@ -61,11 +61,11 @@ def build( types: list[CadworkType], hint_map: dict[str, str] | None = None, stub_types: set[str] | None = None, - ) -> "TypeResolver": + ) -> 'TypeResolver': registry: dict[str, str] = {} for entry in types: registry[entry.cpp_type] = entry.python_name - registry[entry.cpp_type.split("::")[-1]] = entry.python_name + registry[entry.cpp_type.split('::')[-1]] = entry.python_name registry[entry.python_name] = entry.python_name return cls( type_map=dict(type_map), @@ -82,7 +82,7 @@ def resolve_hint(self, name: str) -> str | None: has already flattened it to ``uint64_t`` / ``int32_t``. That naming is authored per parameter, so it beats the flattened type when both exist. """ - bare = name.split("::")[-1].strip() + bare = name.split('::')[-1].strip() if not bare: return None if bare in self.hint_map: @@ -102,16 +102,16 @@ def resolve(self, cpp_type: str, quiet: bool = False) -> tuple[str, str | None]: `quiet` suppresses the unresolved-type warning for speculative lookups (a static_cast target or a @param hint that may not name a real type). """ - text = cpp_type.strip().removeprefix("const ").strip() + text = cpp_type.strip().removeprefix('const ').strip() if text in self.type_map: return (self.type_map[text], None) - vector = re.fullmatch(r"std::vector<(.+)>", text) + vector = re.fullmatch(r'std::vector<(.+)>', text) if vector: inner, needed = self.resolve(vector.group(1), quiet) - return (f"list[{inner}]", needed) + return (f'list[{inner}]', needed) - for candidate in (text, text.rstrip("*").strip()): + for candidate in (text, text.rstrip('*').strip()): if candidate in self.cadwork_types: name = self.cadwork_types[candidate] return (name, name) @@ -120,7 +120,7 @@ def resolve(self, cpp_type: str, quiet: bool = False) -> tuple[str, str | None]: if not quiet: self.unresolved.add(text) - return ("Any", None) + return ('Any', None) # --------------------------------------------------------------------------- @@ -135,7 +135,7 @@ def docstring_safe(text: str) -> str: quote inside, or a trailing double quote adjacent to the closer, would produce a stub that does not parse. """ - cleaned = text.replace('"""', "'''").replace("\\", "\\\\") + cleaned = text.replace('"""', "'''").replace('\\', '\\\\') return cleaned[:-1] + "'" if cleaned.endswith('"') else cleaned @@ -143,29 +143,29 @@ def _default_literal(cpp_default: str | None) -> str | None: if cpp_default is None: return None text = cpp_default.strip() - if text == "true": - return "True" - if text == "false": - return "False" - if text == "nullptr": - return "None" + if text == 'true': + return 'True' + if text == 'false': + return 'False' + if text == 'nullptr': + return 'None' return text def _safe_name(name: str, used: set[str], index: int) -> str: - candidate = name or f"arg{index}" - candidate = re.sub(r"\W", "_", candidate) + candidate = name or f'arg{index}' + candidate = re.sub(r'\W', '_', candidate) if not candidate or candidate[0].isdigit(): - candidate = f"arg{index}" + candidate = f'arg{index}' if keyword.iskeyword(candidate): - candidate = f"{candidate}_" + candidate = f'{candidate}_' while candidate in used: - candidate = f"{candidate}_{index}" + candidate = f'{candidate}_{index}' used.add(candidate) return candidate -_TYPING_NAMES = {"Any", "Callable", "Iterator", "Optional", "Union"} +_TYPING_NAMES = {'Any', 'Callable', 'Iterator', 'Optional', 'Union'} @dataclass @@ -187,7 +187,7 @@ def _referenced_names(annotations: list[str], resolver: TypeResolver) -> tuple[s known = set(resolver.cadwork_types.values()) | _API_TYPE_ALIASES identifiers: set[str] = set() for annotation in annotations: - identifiers.update(re.findall(r"\w+", annotation)) + identifiers.update(re.findall(r'\w+', annotation)) return (identifiers & known, identifiers & _TYPING_NAMES) @@ -211,9 +211,7 @@ def render_function( # left alone -- nothing more specific exists. if needed is None: upgrades = [ - trampoline.param_casts[index] - if index < len(trampoline.param_casts) - else None, + trampoline.param_casts[index] if index < len(trampoline.param_casts) else None, aligned_doc[index][1] if aligned_doc else None, ] for candidate in upgrades: @@ -227,8 +225,8 @@ def render_function( names: list[str] = [] descriptions: list[str] = [] for index, annotation in enumerate(annotations): - raw_name = "" - description = "" + raw_name = '' + description = '' if index < len(binding.arg_names): raw_name = binding.arg_names[index] if aligned_doc: @@ -236,26 +234,24 @@ def render_function( raw_name = raw_name or camel_to_snake(doc_name) description = doc_desc if not raw_name: - raw_name = param_name_fallbacks.get(annotation, "") + raw_name = param_name_fallbacks.get(annotation, '') if not raw_name and index < len(trampoline.param_names): candidate = trampoline.param_names[index] - if not re.fullmatch(r"a\d+", candidate): + if not re.fullmatch(r'a\d+', candidate): raw_name = camel_to_snake(candidate) names.append(_safe_name(raw_name, used, index)) descriptions.append(description) defaults = [ - _default_literal(binding.arg_defaults[index]) - if index < len(binding.arg_defaults) - else None + _default_literal(binding.arg_defaults[index]) if index < len(binding.arg_defaults) else None for index in range(len(annotations)) ] signature_parts: list[str] = [] for name, annotation, default in zip(names, annotations, defaults): - part = f"{name}: {annotation}" + part = f'{name}: {annotation}' if default is not None: - part += f" = {default}" + part += f' = {default}' signature_parts.append(part) return_annotation, return_needed = resolver.resolve(trampoline.return_type) @@ -263,47 +259,41 @@ def render_function( upgraded = resolver.resolve_hint(doc.returns_hint) if upgraded: return_annotation = upgraded - imports, typing_names = _referenced_names( - [*annotations, return_annotation], resolver - ) + imports, typing_names = _referenced_names([*annotations, return_annotation], resolver) - lines = [ - f"def {binding.python_name}({', '.join(signature_parts)}) -> {return_annotation}:" - ] - brief = docstring_safe( - (doc.brief if doc else "") or binding.python_name.replace("_", " ") - ) - if not brief.endswith((".", "!", "?")): - brief += "." + lines = [f'def {binding.python_name}({", ".join(signature_parts)}) -> {return_annotation}:'] + brief = docstring_safe((doc.brief if doc else '') or binding.python_name.replace('_', ' ')) + if not brief.endswith(('.', '!', '?')): + brief += '.' lines.append(f'{_INDENT}"""{brief}') if doc and doc.deprecated: - lines.append("") - lines.append(f"{_INDENT}Deprecated : ") - lines.append(f"{_INDENT * 2}{docstring_safe(doc.deprecated)}") + lines.append('') + lines.append(f'{_INDENT}Deprecated : ') + lines.append(f'{_INDENT * 2}{docstring_safe(doc.deprecated)}') if names: - lines.append("") - lines.append(f"{_INDENT}Parameters:") + lines.append('') + lines.append(f'{_INDENT}Parameters:') for name, description in zip(names, descriptions): - text = docstring_safe(description) or name.replace("_", " ") + "." - lines.append(f"{_INDENT * 2}{name}: {text}") + text = docstring_safe(description) or name.replace('_', ' ') + '.' + lines.append(f'{_INDENT * 2}{name}: {text}') if doc and doc.note: - lines.append("") - lines.append(f"{_INDENT}Note:") - lines.append(f"{_INDENT * 2}{docstring_safe(doc.note)}") + lines.append('') + lines.append(f'{_INDENT}Note:') + lines.append(f'{_INDENT * 2}{docstring_safe(doc.note)}') - if return_annotation != "None": - lines.append("") - lines.append(f"{_INDENT}Returns:") - returns_text = docstring_safe(doc.returns if doc else "") or return_annotation - lines.append(f"{_INDENT * 2}{returns_text}") + if return_annotation != 'None': + lines.append('') + lines.append(f'{_INDENT}Returns:') + returns_text = docstring_safe(doc.returns if doc else '') or return_annotation + lines.append(f'{_INDENT * 2}{returns_text}') lines.append(f'{_INDENT}"""') return RenderedFunction( - text="\n".join(lines), + text='\n'.join(lines), imports=imports, typing_names=typing_names, had_cpp_example=bool(doc and doc.example), @@ -320,9 +310,9 @@ def import_lines(names: set[str], stub_star_imports: bool, known: set[str]) -> l if name in _API_TYPE_ALIASES: if stub_star_imports: continue - lines.append(f"from cadwork.api_types import {name}") + lines.append(f'from cadwork.api_types import {name}') continue - lines.append(f"from cadwork.{name} import {name}") + lines.append(f'from cadwork.{name} import {name}') return lines @@ -340,70 +330,65 @@ class RenderedType: ok: bool = True -def render_enum( - entry: CadworkType, definitions: dict[str, list[EnumMember]] -) -> RenderedType: +def render_enum(entry: CadworkType, definitions: dict[str, list[EnumMember]]) -> RenderedType: """Emit an IntEnum matching the shape of the repo's existing enum stubs. Numeric values come from the C++ enum definition, never from the registration order -- ``py::enum_`` chains carry no values at all. """ warnings: list[str] = [] - bare = entry.cpp_type.split("::")[-1] + bare = entry.cpp_type.split('::')[-1] members = definitions.get(bare, []) by_name = {member.name: member for member in members} resolved: list[tuple[str, int, str]] = [] for python_name, cpp_expression in entry.values: - member = by_name.get(cpp_expression.split("::")[-1]) + member = by_name.get(cpp_expression.split('::')[-1]) if member is None: - warnings.append( - f"cadwork.{entry.python_name}.{python_name}: no C++ value found for " - f"{cpp_expression}" - ) + warnings.append(f'cadwork.{entry.python_name}.{python_name}: no C++ value found for {cpp_expression}') continue resolved.append((python_name, member.value, member.doc)) if not resolved: return RenderedType( - text="", + text='', imports=set(), ok=False, warnings=[ f"cadwork.{entry.python_name}: no member of C++ enum '{bare}' could be " "resolved to a value -- NOT written. Add the declaring header's " - "directory to [source].enum_search_dirs." + 'directory to [source].enum_search_dirs.' ], ) if len(resolved) != len(entry.values): warnings.append( - f"cadwork.{entry.python_name}: {len(resolved)}/{len(entry.values)} members " - "resolved -- review before publishing" + f'cadwork.{entry.python_name}: {len(resolved)}/{len(entry.values)} members ' + 'resolved -- review before publishing' ) - title = entry.python_name.replace("_", " ") + title = entry.python_name.replace('_', ' ') lines = [ - "from enum import IntEnum, unique", - "", - "", - "@unique", - f"class {entry.python_name}(IntEnum):", + 'from enum import IntEnum, unique', + '', + '', + '@unique', + f'class {entry.python_name}(IntEnum):', f'{_INDENT}"""{title}', ] if resolved: lines += [ - "", - f"{_INDENT}Examples:", - f"{_INDENT * 2}>>> cadwork.{entry.python_name}.{resolved[0][0]}", - f"{_INDENT * 2}{resolved[0][0]}", + '', + f'{_INDENT}Examples:', + f'{_INDENT * 2}>>> cadwork.{entry.python_name}.{resolved[0][0]}', + f'{_INDENT * 2}{resolved[0][0]}', ] lines.append(f'{_INDENT}"""') for python_name, value, doc in resolved: - lines.append(f"{_INDENT}{python_name} = {value}") + lines.append(f'{_INDENT}{python_name} = {value}') lines.append(f'{_INDENT}"""{docstring_safe(doc)}"""') - lines += ["", f"{_INDENT}def __int__(self) -> int:", f"{_INDENT * 2}return self.value"] + lines += ['', f'{_INDENT}def __int__(self) -> int:', f'{_INDENT * 2}return self.value'] - return RenderedType(text="\n".join(lines) + "\n", imports=set(), warnings=warnings) + return RenderedType(text='\n'.join(lines) + '\n', imports=set(), warnings=warnings) def render_class(entry: CadworkType, resolver: TypeResolver) -> RenderedType: @@ -425,45 +410,42 @@ def render_class(entry: CadworkType, resolver: TypeResolver) -> RenderedType: annotation, needed = resolver.resolve(cpp_type) if needed: imports.add(needed) - parts.append(f"arg{index}: {annotation}") - body.append(f"{_INDENT}def __init__(self, {', '.join(parts)}) -> None:") + parts.append(f'arg{index}: {annotation}') + body.append(f'{_INDENT}def __init__(self, {", ".join(parts)}) -> None:') body.append(f'{_INDENT * 2}"""Initialize a {entry.python_name}."""') - body.append("") + body.append('') break if entry.fields: for name, _member, writable in entry.fields: - body.append(f"{_INDENT}{name}: Any") + body.append(f'{_INDENT}{name}: Any') body.append(f'{_INDENT}"""{"read/write" if writable else "read-only"}."""') - body.append("") + body.append('') warnings.append( - f"cadwork.{entry.python_name}: field types are not recoverable from the " - "bindings -- annotated Any" + f'cadwork.{entry.python_name}: field types are not recoverable from the bindings -- annotated Any' ) for name, _member in entry.methods: - if name.startswith("__"): + if name.startswith('__'): continue - body.append(f"{_INDENT}def {name}(self) -> Any:") + body.append(f'{_INDENT}def {name}(self) -> Any:') body.append(f'{_INDENT * 2}"""{name.replace("_", " ")}."""') - body.append("") + body.append('') if entry.methods: warnings.append( - f"cadwork.{entry.python_name}: method signatures are not recoverable from " - "the bindings -- parameters omitted, returns annotated Any" + f'cadwork.{entry.python_name}: method signatures are not recoverable from ' + 'the bindings -- parameters omitted, returns annotated Any' ) header = [ - f"class {entry.python_name}:", + f'class {entry.python_name}:', f'{_INDENT}"""{entry.python_name.replace("_", " ")}."""', - "", + '', ] - prefix = ["from typing import Any"] - prefix += [f"from cadwork.{name} import {name}" for name in sorted(imports)] - lines = [*prefix, "", ""] + header + body - return RenderedType( - text="\n".join(lines).rstrip() + "\n", imports=imports, warnings=warnings - ) + prefix = ['from typing import Any'] + prefix += [f'from cadwork.{name} import {name}' for name in sorted(imports)] + lines = [*prefix, '', ''] + header + body + return RenderedType(text='\n'.join(lines).rstrip() + '\n', imports=imports, warnings=warnings) # --------------------------------------------------------------------------- @@ -474,11 +456,11 @@ def render_class(entry: CadworkType, resolver: TypeResolver) -> RenderedType: def patch_cadwork_init(path: Path, name: str, kind: str) -> bool: """Insert the re-export line and the ``__all__`` entry for a new type.""" source = _files.read_text(path) - if f"from .{name} import {name}" in source: + if f'from .{name} import {name}' in source: return False lines = source.splitlines() - section = "# --- Enumerations ---" if kind == "enum" else "# --- Data classes ---" - import_line = f"from .{name} import {name} as {name}" + section = '# --- Enumerations ---' if kind == 'enum' else '# --- Data classes ---' + import_line = f'from .{name} import {name} as {name}' try: section_index = lines.index(section) @@ -486,25 +468,17 @@ def patch_cadwork_init(path: Path, name: str, kind: str) -> bool: return False end = section_index + 1 - while end < len(lines) and lines[end].startswith("from ."): + while end < len(lines) and lines[end].startswith('from .'): end += 1 block = lines[section_index + 1 : end] - position = section_index + 1 + sum( - 1 for line in block if line < import_line - ) + position = section_index + 1 + sum(1 for line in block if line < import_line) lines.insert(position, import_line) - all_start = next( - (index for index, line in enumerate(lines) if line.startswith("__all__")), None - ) + all_start = next((index for index, line in enumerate(lines) if line.startswith('__all__')), None) if all_start is not None: - marker = "# Enumerations" if kind == "enum" else "# Data classes" + marker = '# Enumerations' if kind == 'enum' else '# Data classes' try: - marker_index = next( - index - for index in range(all_start, len(lines)) - if lines[index].strip() == marker - ) + marker_index = next(index for index in range(all_start, len(lines)) if lines[index].strip() == marker) except StopIteration: marker_index = all_start entry = f' "{name}",' @@ -515,29 +489,31 @@ def patch_cadwork_init(path: Path, name: str, kind: str) -> bool: position = marker_index + 1 + sum(1 for line in block if line < entry) lines.insert(position, entry) - _files.write_text(path, "\n".join(lines) + "\n") + _files.write_text(path, '\n'.join(lines) + '\n') return True def write_docs_page(docs_dir: Path, slug: str, title: str, target: str) -> Path: - page = docs_dir / f"{slug}.md" - _files.write_text(page, f"# {title}\n\n::: {target}\n rendering:\n show_root_heading: false\n" - " show_source: true\n") + page = docs_dir / f'{slug}.md' + _files.write_text( + page, + f'# {title}\n\n::: {target}\n rendering:\n show_root_heading: false\n show_source: true\n', + ) return page def append_to_enums_page(docs_dir: Path, enums_page: str, name: str) -> Path: page = docs_dir / enums_page - existing = _files.read_text(page) if page.is_file() else "# Enumerations\n" - if f"::: cadwork.{name}" in existing: + existing = _files.read_text(page) if page.is_file() else '# Enumerations\n' + if f'::: cadwork.{name}' in existing: return page - block = f"\n## {name}\n\n::: cadwork.{name}\n" - _files.write_text(page, existing.rstrip("\n") + "\n" + block) + block = f'\n## {name}\n\n::: cadwork.{name}\n' + _files.write_text(page, existing.rstrip('\n') + '\n' + block) return page def _title_case(slug: str) -> str: - return " ".join(word.capitalize() for word in slug.split("_")) + return ' '.join(word.capitalize() for word in slug.split('_')) def patch_mkdocs_nav(path: Path, slug: str, title: str, under: str) -> bool: @@ -547,25 +523,25 @@ def patch_mkdocs_nav(path: Path, slug: str, title: str, under: str) -> bool: would drop every comment and the hand-tuned ordering in this file. """ lines = _files.read_text(path).splitlines() - entry_suffix = f"documentation/{slug}.md" + entry_suffix = f'documentation/{slug}.md' if any(entry_suffix in line for line in lines): return False - if under == "Cadwork": + if under == 'Cadwork': anchor = next( - (index for index, line in enumerate(lines) if line.strip() == "- Cadwork:"), + (index for index, line in enumerate(lines) if line.strip() == '- Cadwork:'), None, ) else: anchor = next( - (index for index, line in enumerate(lines) if line.strip() == "- Reference:"), + (index for index, line in enumerate(lines) if line.strip() == '- Reference:'), None, ) if anchor is None: return False indent = len(lines[anchor]) - len(lines[anchor].lstrip()) + 4 - entry = f"{' ' * indent}- {title}: {entry_suffix}" + entry = f'{" " * indent}- {title}: {entry_suffix}' insert_at = anchor + 1 cursor = anchor + 1 @@ -577,7 +553,7 @@ def patch_mkdocs_nav(path: Path, slug: str, title: str, under: str) -> bool: current_indent = len(line) - len(line.lstrip()) if current_indent < indent: break - if current_indent == indent and line.strip().startswith("- "): + if current_indent == indent and line.strip().startswith('- '): if line.strip() < entry.strip(): insert_at = cursor + 1 else: @@ -588,7 +564,7 @@ def patch_mkdocs_nav(path: Path, slug: str, title: str, under: str) -> bool: insert_at = cursor lines.insert(insert_at, entry) - _files.write_text(path, "\n".join(lines) + "\n") + _files.write_text(path, '\n'.join(lines) + '\n') return True @@ -596,21 +572,21 @@ def patch_pyproject_packages(path: Path, package: str) -> bool: source = _files.read_text(path) if f'"{package}"' in source: return False - match = re.search(r"(packages\s*=\s*\[)(.*?)(\])", source, re.S) + match = re.search(r'(packages\s*=\s*\[)(.*?)(\])', source, re.S) if match is None: return False body = match.group(2) - entries = [item.strip() for item in body.split(",") if item.strip()] + entries = [item.strip() for item in body.split(',') if item.strip()] entries.append(f'"{package}"') entries.sort(key=lambda item: item.strip('"')) - rendered = "\n" + ",\n".join(f" {entry}" for entry in entries) + "\n" + rendered = '\n' + ',\n'.join(f' {entry}' for entry in entries) + '\n' source = source[: match.start(2)] + rendered + source[match.end(2) :] _files.write_text(path, source) return True _VERSION_MINOR_RE = re.compile( - r"^[^\S\n]*(?:const\s+)?(?:uint32_t|unsigned\s+int|int)\s+versionMinor\s*=\s*(\d+)", + r'^[^\S\n]*(?:const\s+)?(?:uint32_t|unsigned\s+int|int)\s+versionMinor\s*=\s*(\d+)', re.M, ) @@ -654,32 +630,28 @@ def sync_version(path: Path, api_minor: int | None) -> VersionChange | None: if match is None: return None major, minor, patch = match.group(2), int(match.group(3)), int(match.group(4)) - old = f"{major}.{minor}.{patch}" + old = f'{major}.{minor}.{patch}' warning: str | None = None if api_minor is None: - new = f"{major}.{minor}.{patch + 1}" + new = f'{major}.{minor}.{patch + 1}' warning = ( - "no versionMinor found in the CwAPI3D version header -- fell back to a " - f"patch bump ({old} -> {new}); confirm the version is right before release" + 'no versionMinor found in the CwAPI3D version header -- fell back to a ' + f'patch bump ({old} -> {new}); confirm the version is right before release' ) elif api_minor > minor: - new = f"{major}.{api_minor}.0" + new = f'{major}.{api_minor}.0' else: - new = f"{major}.{minor}.{patch + 1}" + new = f'{major}.{minor}.{patch + 1}' if api_minor < minor: # Syncing against an older cadlib checkout. Following it down would # produce a version PyPI has already seen. warning = ( - f"CwAPI3D versionMinor is {api_minor} but the package is already at " - f"{old} -- kept the higher minor and bumped the patch instead " - f"({old} -> {new}). Point [paths].cadlib_root at the newer source if " - "that is not intended." + f'CwAPI3D versionMinor is {api_minor} but the package is already at ' + f'{old} -- kept the higher minor and bumped the patch instead ' + f'({old} -> {new}). Point [paths].cadlib_root at the newer source if ' + 'that is not intended.' ) - source = ( - source[: match.start()] - + f"{match.group(1)}{new}{match.group(5)}" - + source[match.end() :] - ) + source = source[: match.start()] + f'{match.group(1)}{new}{match.group(5)}' + source[match.end() :] _files.write_text(path, source) return VersionChange(old=old, new=new, warning=warning) @@ -687,10 +659,13 @@ def sync_version(path: Path, api_minor: int | None) -> VersionChange | None: def create_controller_package(src_dir: Path, module: str) -> Path: package = src_dir / module package.mkdir(parents=True, exist_ok=True) - (package / "py.typed").write_bytes(b"") - init = package / "__init__.pyi" + (package / 'py.typed').write_bytes(b'') + init = package / '__init__.pyi' if not init.is_file(): title = _title_case(module) - _files.write_text(init, f'"""{title}.\n\nTODO: describe this module\'s domain -- the C++ bindings carry no\n' - f'module-level documentation to derive it from.\n"""\n') + _files.write_text( + init, + f'"""{title}.\n\nTODO: describe this module\'s domain -- the C++ bindings carry no\n' + f'module-level documentation to derive it from.\n"""\n', + ) return init diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/_files.py b/.claude/skills/sync-cwapi3d-stubs/scripts/_files.py index 4a1566e..dacccc0 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/_files.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/_files.py @@ -12,7 +12,7 @@ from pathlib import Path -_DEFAULT_NEWLINE = "\n" +_DEFAULT_NEWLINE = '\n' def set_default_newline(anchor: Path) -> str: @@ -30,26 +30,26 @@ def detect_newline(path: Path, default: str | None = None) -> str: default = _DEFAULT_NEWLINE if default is None else default if not path.is_file(): return default - with path.open("rb") as handle: + with path.open('rb') as handle: sample = handle.read(65536) - if b"\r\n" in sample: - return "\r\n" - if b"\n" in sample: - return "\n" + if b'\r\n' in sample: + return '\r\n' + if b'\n' in sample: + return '\n' return default def read_text(path: Path) -> str: """Read with universal newlines: the returned text always uses ``\\n``.""" - return path.read_text(encoding="utf-8") + return path.read_text(encoding='utf-8') def write_text(path: Path, text: str, newline: str | None = None) -> None: """Write `text` (LF-separated) back using the file's own line ending.""" terminator = newline if newline is not None else detect_newline(path) - with path.open("w", encoding="utf-8", newline="") as handle: - handle.write(text.replace("\r\n", "\n").replace("\n", terminator)) + with path.open('w', encoding='utf-8', newline='') as handle: + handle.write(text.replace('\r\n', '\n').replace('\n', terminator)) def write_lines(path: Path, lines: list[str], newline: str | None = None) -> None: - write_text(path, "\n".join(lines) + "\n", newline) + write_text(path, '\n'.join(lines) + '\n', newline) diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/_stubs.py b/.claude/skills/sync-cwapi3d-stubs/scripts/_stubs.py index e8b185e..4e630ba 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/_stubs.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/_stubs.py @@ -50,7 +50,7 @@ def _measure_blank_lines(source: str) -> int: counts: dict[int, int] = {} previous_def = None for index, line in enumerate(lines): - if not line.startswith("def "): + if not line.startswith('def '): continue if previous_def is not None: blanks = 0 @@ -77,15 +77,15 @@ def _parse_controller(module: str, path: Path) -> ControllerStub: elif isinstance(node, ast.ImportFrom): stub.last_import_line = max(stub.last_import_line, node.end_lineno or 0) for alias in node.names: - if alias.name == "*": - if node.module == "cadwork.api_types": + if alias.name == '*': + if node.module == 'cadwork.api_types': stub.star_imports_api_types = True else: stub.imported_names.add(alias.asname or alias.name) elif isinstance(node, ast.Import): stub.last_import_line = max(stub.last_import_line, node.end_lineno or 0) for alias in node.names: - stub.imported_names.add(alias.asname or alias.name.split(".")[0]) + stub.imported_names.add(alias.asname or alias.name.split('.')[0]) return stub @@ -99,9 +99,7 @@ def _parse_type(path: Path) -> TypeStub: for child in node.body: if isinstance(child, (ast.FunctionDef, ast.AsyncFunctionDef)): members.add(child.name) - elif isinstance(child, ast.AnnAssign) and isinstance( - child.target, ast.Name - ): + elif isinstance(child, ast.AnnAssign) and isinstance(child.target, ast.Name): members.add(child.target.id) elif isinstance(child, ast.Assign): for target in child.targets: @@ -118,34 +116,33 @@ def _exported_from_cadwork_init(path: Path) -> set[str]: for node in tree.body: if isinstance(node, ast.Assign): for target in node.targets: - if isinstance(target, ast.Name) and target.id == "__all__": + if isinstance(target, ast.Name) and target.id == '__all__': if isinstance(node.value, (ast.List, ast.Tuple)): return { element.value for element in node.value.elts - if isinstance(element, ast.Constant) - and isinstance(element.value, str) + if isinstance(element, ast.Constant) and isinstance(element.value, str) } return set() def parse(src_dir: Path) -> StubInventory: controllers: dict[str, ControllerStub] = {} - for init in sorted(src_dir.glob("*/__init__.pyi")): + for init in sorted(src_dir.glob('*/__init__.pyi')): module = init.parent.name - if module == "cadwork": + if module == 'cadwork': continue controllers[module] = _parse_controller(module, init) - cadwork_dir = src_dir / "cadwork" + cadwork_dir = src_dir / 'cadwork' types: dict[str, TypeStub] = {} if cadwork_dir.is_dir(): - for stub_path in sorted(cadwork_dir.glob("*.pyi")): - if stub_path.stem == "__init__": + for stub_path in sorted(cadwork_dir.glob('*.pyi')): + if stub_path.stem == '__init__': continue types[stub_path.stem] = _parse_type(stub_path) - cadwork_init = cadwork_dir / "__init__.pyi" + cadwork_init = cadwork_dir / '__init__.pyi' return StubInventory( controllers=controllers, types=types, @@ -156,10 +153,10 @@ def parse(src_dir: Path) -> StubInventory: def append_block(path: Path, block: str, blank_lines: int) -> None: """Append `block` to `path`, separated by `blank_lines` blank lines.""" - existing = _files.read_text(path) if path.is_file() else "" - trimmed = existing.rstrip("\n") - separator = "\n" * (blank_lines + 1) if trimmed else "" - _files.write_text(path, f"{trimmed}{separator}{block.rstrip()}\n") + existing = _files.read_text(path) if path.is_file() else '' + trimmed = existing.rstrip('\n') + separator = '\n' * (blank_lines + 1) if trimmed else '' + _files.write_text(path, f'{trimmed}{separator}{block.rstrip()}\n') def insert_imports(path: Path, imports: list[str]) -> None: @@ -174,19 +171,15 @@ def insert_imports(path: Path, imports: list[str]) -> None: insert_at = 0 for index, line in enumerate(lines): - if re.match(r"^(from|import)\s", line): + if re.match(r'^(from|import)\s', line): insert_at = index + 1 if insert_at == 0: # No imports yet: land just after the module docstring. tree = ast.parse(source) - if ( - tree.body - and isinstance(tree.body[0], ast.Expr) - and isinstance(tree.body[0].value, ast.Constant) - ): - insert_at = (tree.body[0].end_lineno or 1) - lines.insert(insert_at, "") + if tree.body and isinstance(tree.body[0], ast.Expr) and isinstance(tree.body[0].value, ast.Constant): + insert_at = tree.body[0].end_lineno or 1 + lines.insert(insert_at, '') insert_at += 1 lines[insert_at:insert_at] = wanted - _files.write_text(path, "\n".join(lines) + "\n") + _files.write_text(path, '\n'.join(lines) + '\n') diff --git a/.claude/skills/sync-cwapi3d-stubs/scripts/sync_stubs.py b/.claude/skills/sync-cwapi3d-stubs/scripts/sync_stubs.py index 1572b14..d7d2c7b 100644 --- a/.claude/skills/sync-cwapi3d-stubs/scripts/sync_stubs.py +++ b/.claude/skills/sync-cwapi3d-stubs/scripts/sync_stubs.py @@ -46,7 +46,7 @@ class Gap: kind: str # "function" | "module" | "type" module: str name: str - detail: str = "" + detail: str = '' @dataclass @@ -63,22 +63,22 @@ def as_dict(self) -> dict: def rows(items: list[Gap]) -> list[dict]: return [ { - "kind": gap.kind, - "module": gap.module, - "name": gap.name, - "detail": gap.detail, + 'kind': gap.kind, + 'module': gap.module, + 'name': gap.name, + 'detail': gap.detail, } for gap in items ] return { - "missing": rows(self.missing), - "blacklisted": rows(self.blacklisted), - "orphans": rows(self.orphans), - "warnings": self.warnings, - "written": self.written, - "version_bump": list(self.version_bump) if self.version_bump else None, - "api_version_minor": self.api_version_minor, + 'missing': rows(self.missing), + 'blacklisted': rows(self.blacklisted), + 'orphans': rows(self.orphans), + 'warnings': self.warnings, + 'written': self.written, + 'version_bump': list(self.version_bump) if self.version_bump else None, + 'api_version_minor': self.api_version_minor, } @@ -86,7 +86,7 @@ def _is_blacklisted(config: _config.Config, module: str, name: str) -> bool: return ( module in config.blacklist_modules or name in config.blacklist_methods - or f"{module}.{name}" in config.blacklist_qualified + or f'{module}.{name}' in config.blacklist_qualified ) @@ -102,16 +102,16 @@ def build_report( # which reads as "nothing to do" rather than "deliberately skipped". for module in sorted(only & config.blacklist_modules): report.warnings.append( - f"{module} is blacklisted in [blacklist].modules -- nothing will be " - "generated for it. Remove the entry to start syncing it." + f'{module} is blacklisted in [blacklist].modules -- nothing will be ' + 'generated for it. Remove the entry to start syncing it.' ) for binding in inventory.bindings: - if binding.module == "cadwork": + if binding.module == 'cadwork': continue if only and binding.module not in only: continue - gap = Gap(kind="function", module=binding.module, name=binding.python_name) + gap = Gap(kind='function', module=binding.module, name=binding.python_name) stub = stubs.controllers.get(binding.module) already_present = stub is not None and binding.python_name in stub.functions if already_present: @@ -122,7 +122,7 @@ def build_report( report.blacklisted.append(gap) continue if stub is None: - gap.detail = "module missing" + gap.detail = 'module missing' report.missing.append(gap) bound_by_module: dict[str, set[str]] = {} @@ -132,31 +132,25 @@ def build_report( if (only and module not in only) or module in config.blacklist_modules: continue for name in sorted(stub.functions - bound_by_module.get(module, set())): - report.orphans.append( - Gap(kind="function", module=module, name=name, detail="no C++ binding") - ) + report.orphans.append(Gap(kind='function', module=module, name=name, detail='no C++ binding')) - if not only or "cadwork" in only: + if not only or 'cadwork' in only: known = set(stubs.types) | stubs.exported_types for entry in inventory.types: names = {entry.python_name, *entry.aliases} if entry.python_name in config.blacklist_types: - report.blacklisted.append( - Gap(kind="type", module="cadwork", name=entry.python_name) - ) + report.blacklisted.append(Gap(kind='type', module='cadwork', name=entry.python_name)) continue if names & known: continue - report.missing.append( - Gap(kind="type", module="cadwork", name=entry.python_name, detail=entry.kind) - ) + report.missing.append(Gap(kind='type', module='cadwork', name=entry.python_name, detail=entry.kind)) for module in bound_by_module: - if module == "cadwork" or (only and module not in only): + if module == 'cadwork' or (only and module not in only): continue if module in stubs.controllers: continue - gap = Gap(kind="module", module=module, name=module, detail="package missing") + gap = Gap(kind='module', module=module, name=module, detail='package missing') if module in config.blacklist_modules: report.blacklisted.append(gap) else: @@ -182,54 +176,43 @@ def apply_changes( ) touched_src = False - new_modules = {gap.name for gap in report.missing if gap.kind == "module"} + new_modules = {gap.name for gap in report.missing if gap.kind == 'module'} for module in sorted(new_modules): init = _emit.create_controller_package(config.src_dir, module) stubs.controllers[module] = _stubs.ControllerStub(module=module, path=init) report.written.append(str(init.relative_to(config.stub_repo))) if _emit.patch_pyproject_packages(config.pyproject, module): report.written.append(str(config.pyproject.relative_to(config.stub_repo))) - page = _emit.write_docs_page( - config.docs_dir, module, _emit._title_case(module), module - ) + page = _emit.write_docs_page(config.docs_dir, module, _emit._title_case(module), module) report.written.append(str(page.relative_to(config.stub_repo))) - if _emit.patch_mkdocs_nav( - config.mkdocs, module, _emit._title_case(module), "Reference" - ): + if _emit.patch_mkdocs_nav(config.mkdocs, module, _emit._title_case(module), 'Reference'): report.written.append(str(config.mkdocs.relative_to(config.stub_repo))) touched_src = True by_module: dict[str, list[str]] = {} imports_by_module: dict[str, set[str]] = {} typing_by_module: dict[str, set[str]] = {} - wanted = { - (gap.module, gap.name) for gap in report.missing if gap.kind == "function" - } + wanted = {(gap.module, gap.name) for gap in report.missing if gap.kind == 'function'} for binding in inventory.bindings: if (binding.module, binding.python_name) not in wanted: continue - trampoline = inventory.trampolines.get(binding.symbol or "") + trampoline = inventory.trampolines.get(binding.symbol or '') if trampoline is None: - report.warnings.append( - f"{binding.module}.{binding.python_name}: no signature found -- skipped" - ) + report.warnings.append(f'{binding.module}.{binding.python_name}: no signature found -- skipped') continue doc = doxygen.lookup(trampoline.accessor, trampoline.cpp_method) - rendered = _emit.render_function( - binding, trampoline, doc, resolver, config.param_names - ) + rendered = _emit.render_function(binding, trampoline, doc, resolver, config.param_names) by_module.setdefault(binding.module, []).append(rendered.text) imports_by_module.setdefault(binding.module, set()).update(rendered.imports) typing_by_module.setdefault(binding.module, set()).update(rendered.typing_names) if rendered.thin_doc: report.warnings.append( - f"{binding.module}.{binding.python_name}: no Doxygen @brief -- " - "docstring is a placeholder" + f'{binding.module}.{binding.python_name}: no Doxygen @brief -- docstring is a placeholder' ) if rendered.had_cpp_example: report.warnings.append( - f"{binding.module}.{binding.python_name}: the interface carries a C++ " - "@par Example that was NOT translated -- port it by hand" + f'{binding.module}.{binding.python_name}: the interface carries a C++ ' + '@par Example that was NOT translated -- port it by hand' ) for module, blocks in sorted(by_module.items()): @@ -241,54 +224,47 @@ def apply_changes( ) wanted_typing = sorted(typing_by_module.get(module, set()) - stub.imported_names) if wanted_typing: - lines.insert(0, f"from typing import {', '.join(wanted_typing)}") + lines.insert(0, f'from typing import {", ".join(wanted_typing)}') _stubs.insert_imports(stub.path, lines) - separator = "\n" * (stub.blank_lines_between_defs + 1) - _stubs.append_block( - stub.path, separator.join(blocks), stub.blank_lines_between_defs - ) + separator = '\n' * (stub.blank_lines_between_defs + 1) + _stubs.append_block(stub.path, separator.join(blocks), stub.blank_lines_between_defs) report.written.append(str(stub.path.relative_to(config.stub_repo))) touched_src = True - wanted_types = {gap.name for gap in report.missing if gap.kind == "type"} + wanted_types = {gap.name for gap in report.missing if gap.kind == 'type'} for entry in inventory.types: if entry.python_name not in wanted_types: continue - if entry.kind == "enum": + if entry.kind == 'enum': rendered = _emit.render_enum(entry, enum_definitions) else: rendered = _emit.render_class(entry, resolver) report.warnings.extend(rendered.warnings) if not rendered.ok: continue - target = config.src_dir / "cadwork" / f"{entry.python_name}.pyi" + target = config.src_dir / 'cadwork' / f'{entry.python_name}.pyi' _files.write_text(target, rendered.text) report.written.append(str(target.relative_to(config.stub_repo))) if _emit.patch_cadwork_init(stubs.cadwork_init, entry.python_name, entry.kind): report.written.append(str(stubs.cadwork_init.relative_to(config.stub_repo))) - if entry.kind == "enum": - page = _emit.append_to_enums_page( - config.docs_dir, config.enums_page, entry.python_name - ) + if entry.kind == 'enum': + page = _emit.append_to_enums_page(config.docs_dir, config.enums_page, entry.python_name) report.written.append(str(page.relative_to(config.stub_repo))) else: page = _emit.write_docs_page( config.docs_dir, entry.python_name, entry.python_name, - f"cadwork.{entry.python_name}", + f'cadwork.{entry.python_name}', ) report.written.append(str(page.relative_to(config.stub_repo))) - if _emit.patch_mkdocs_nav( - config.mkdocs, entry.python_name, entry.python_name, "Cadwork" - ): + if _emit.patch_mkdocs_nav(config.mkdocs, entry.python_name, entry.python_name, 'Cadwork'): report.written.append(str(config.mkdocs.relative_to(config.stub_repo))) touched_src = True if resolver.unresolved: report.warnings.append( - "C++ types with no Python mapping (annotated Any): " - + ", ".join(sorted(resolver.unresolved)) + 'C++ types with no Python mapping (annotated Any): ' + ', '.join(sorted(resolver.unresolved)) ) if touched_src and config.bump_version: @@ -300,8 +276,7 @@ def apply_changes( report.warnings.append(change.warning) else: report.warnings.append( - "could not set [project].version -- the publish workflow will reject " - "a duplicate upload" + 'could not set [project].version -- the publish workflow will reject a duplicate upload' ) report.written = sorted(set(report.written)) @@ -313,81 +288,76 @@ def syntax_check(paths: list[Path]) -> list[str]: problems: list[str] = [] for path in paths: - if path.suffix != ".pyi": + if path.suffix != '.pyi': continue try: ast.parse(_files.read_text(path)) except SyntaxError as error: - problems.append(f"{path}: {error}") + problems.append(f'{path}: {error}') return problems def print_report(report: Report, applied: bool) -> None: if report.api_version_minor is not None: - print(f"CwAPI3D versionMinor: {report.api_version_minor}\n") + print(f'CwAPI3D versionMinor: {report.api_version_minor}\n') by_module: dict[str, list[Gap]] = {} for gap in report.missing: by_module.setdefault(gap.module, []).append(gap) if not report.missing: - print("In sync: no missing declarations.") + print('In sync: no missing declarations.') else: total = len(report.missing) - print(f"{total} missing declaration(s):\n") + print(f'{total} missing declaration(s):\n') for module in sorted(by_module): gaps = by_module[module] - print(f" {module} ({len(gaps)})") + print(f' {module} ({len(gaps)})') for gap in sorted(gaps, key=lambda item: item.name): - suffix = f" [{gap.detail}]" if gap.detail else "" - print(f" {gap.kind:8} {gap.name}{suffix}") + suffix = f' [{gap.detail}]' if gap.detail else '' + print(f' {gap.kind:8} {gap.name}{suffix}') print() if report.blacklisted: - skipped_modules = sorted( - gap.module for gap in report.blacklisted if gap.kind == "module" - ) + skipped_modules = sorted(gap.module for gap in report.blacklisted if gap.kind == 'module') suffix = ( - f" (whole module{'s' if len(skipped_modules) > 1 else ''}: " - f"{', '.join(skipped_modules)})" + f' (whole module{"s" if len(skipped_modules) > 1 else ""}: {", ".join(skipped_modules)})' if skipped_modules - else "" + else '' ) - print(f"{len(report.blacklisted)} blacklisted entr(ies) skipped{suffix}.") + print(f'{len(report.blacklisted)} blacklisted entr(ies) skipped{suffix}.') if report.orphans: - print(f"\n{len(report.orphans)} stub function(s) with no C++ binding (kept):") + print(f'\n{len(report.orphans)} stub function(s) with no C++ binding (kept):') for gap in report.orphans: - print(f" {gap.module}.{gap.name}") + print(f' {gap.module}.{gap.name}') if applied: if report.version_bump: - print(f"\nversion {report.version_bump[0]} -> {report.version_bump[1]}") - print(f"\n{len(report.written)} file(s) written:") + print(f'\nversion {report.version_bump[0]} -> {report.version_bump[1]}') + print(f'\n{len(report.written)} file(s) written:') for path in report.written: - print(f" {path}") + print(f' {path}') if report.warnings: - print(f"\n{len(report.warnings)} warning(s):") + print(f'\n{len(report.warnings)} warning(s):') for warning in report.warnings: - print(f" - {warning}") + print(f' - {warning}') def main(argv: list[str] | None = None) -> int: - parser = argparse.ArgumentParser( - description="Sync cwapi3d .pyi stubs with the CwAPI3D pybind11 bindings." - ) + parser = argparse.ArgumentParser(description='Sync cwapi3d .pyi stubs with the CwAPI3D pybind11 bindings.') mode = parser.add_mutually_exclusive_group() mode.add_argument( - "--dry-run", - action="store_true", - help="report gaps without writing (default)", + '--dry-run', + action='store_true', + help='report gaps without writing (default)', ) - mode.add_argument("--apply", action="store_true", help="write missing declarations") - parser.add_argument("--json", action="store_true", help="machine-readable output") + mode.add_argument('--apply', action='store_true', help='write missing declarations') + parser.add_argument('--json', action='store_true', help='machine-readable output') parser.add_argument( - "--only", - action="append", + '--only', + action='append', default=[], - metavar="MODULE", + metavar='MODULE', help="restrict to one module (repeatable); 'cadwork' covers the types", ) args = parser.parse_args(argv) @@ -395,18 +365,16 @@ def main(argv: list[str] | None = None) -> int: try: config = _config.load() except _config.ConfigError as error: - print(f"config error: {error}", file=sys.stderr) + print(f'config error: {error}', file=sys.stderr) return EXIT_ERROR try: inventory = _cpp_bindings.parse(config.python_controller) doxygen = _doxygen.parse(config.interface_include_dir) - enum_definitions = _cpp_bindings.parse_enum_definitions( - list(config.enum_search_dirs) - ) + enum_definitions = _cpp_bindings.parse_enum_definitions(list(config.enum_search_dirs)) stubs = _stubs.parse(config.src_dir) except (OSError, ValueError, SyntaxError) as error: - print(f"parse error: {error}", file=sys.stderr) + print(f'parse error: {error}', file=sys.stderr) return EXIT_ERROR only = set(args.only) @@ -414,10 +382,7 @@ def main(argv: list[str] | None = None) -> int: unknown = sorted(only - known_modules) if unknown: print( - "unknown --only module(s): " - + ", ".join(unknown) - + "\nknown: " - + ", ".join(sorted(known_modules)), + 'unknown --only module(s): ' + ', '.join(unknown) + '\nknown: ' + ', '.join(sorted(known_modules)), file=sys.stderr, ) return EXIT_ERROR @@ -429,7 +394,7 @@ def main(argv: list[str] | None = None) -> int: apply_changes(config, inventory, stubs, doxygen, enum_definitions, report) problems = syntax_check([config.stub_repo / path for path in report.written]) if problems: - report.warnings.extend(f"SYNTAX ERROR {problem}" for problem in problems) + report.warnings.extend(f'SYNTAX ERROR {problem}' for problem in problems) if args.json: print(json.dumps(report.as_dict(), indent=2)) @@ -437,11 +402,9 @@ def main(argv: list[str] | None = None) -> int: print_report(report, applied=args.apply) if args.apply: - return EXIT_ERROR if any( - warning.startswith("SYNTAX ERROR") for warning in report.warnings - ) else EXIT_OK + return EXIT_ERROR if any(warning.startswith('SYNTAX ERROR') for warning in report.warnings) else EXIT_OK return EXIT_GAPS if report.missing else EXIT_OK -if __name__ == "__main__": +if __name__ == '__main__': raise SystemExit(main()) diff --git a/docs/auto_attributes.md b/docs/auto_attributes.md index db4229b..c272314 100644 --- a/docs/auto_attributes.md +++ b/docs/auto_attributes.md @@ -6,35 +6,35 @@ hide: # Auto Attributes ## Script filled attributes -Each component in cadwork is described geometrically and with regard to its position in the -entire construction project. On the other hand there is an almost unlimited number -of further attributes is available. Some of these attributes like color, material, name, -building (building) and storey (storey) have to be set during the generation of the component. -during the generation of the component. Others are optionally available to the user. Each of these +Each component in cadwork is described geometrically and with regard to its position in the +entire construction project. On the other hand there is an almost unlimited number +of further attributes is available. Some of these attributes like color, material, name, +building (building) and storey (storey) have to be set during the generation of the component. +during the generation of the component. Others are optionally available to the user. Each of these attributes are explicitly defined by the user by setting them via Modify. -Attributes are used to fully describe the part properties. +Attributes are used to fully describe the part properties. -Furthermore, they are used for the creation of a suitable structure of the construction project -and for the transfer of specific information to downstream systems such as an +Furthermore, they are used for the creation of a suitable structure of the construction project +and for the transfer of specific information to downstream systems such as an such as an ERP system. -Often, the content of an attribute is dependent on the content of other attributes or even -geometric information. In this case, it is tedious to define the content manually. -manually. For this reason cadwork provides in version 29 attributes which can -which calculate their content independently with the help of a script at runtime. -These are the so-called script-filled attributes. As script language Python -is used. The Python script has access to various properties of the parts via the cadwork API. -of the parts. These can be evaluated in the script and the content of the attribute +Often, the content of an attribute is dependent on the content of other attributes or even +geometric information. In this case, it is tedious to define the content manually. +manually. For this reason cadwork provides in version 29 attributes which can +which calculate their content independently with the help of a script at runtime. +These are the so-called script-filled attributes. As script language Python +is used. The Python script has access to various properties of the parts via the cadwork API. +of the parts. These can be evaluated in the script and the content of the attribute can be calculated. -In contrast to all previous attributes, the content of a script-filled -attribute is not defined manually by the user. The task of the user is to create a -Python script, which on the basis of other element properties (geometry and attributes) to calculate the content of the script-filled attribute. The -calculated content is displayed as for all other attributes (Modify, -info window, plan outputs), can be used for activating/deactivating as well as showing/hiding -can be used for activating/deactivating and hiding, can be used as a comparison and sorting criterion for the -list calculation and is exported to the different lists. -The only difference to the known attributes is the automated generation of the +In contrast to all previous attributes, the content of a script-filled +attribute is not defined manually by the user. The task of the user is to create a +Python script, which on the basis of other element properties (geometry and attributes) to calculate the content of the script-filled attribute. The +calculated content is displayed as for all other attributes (Modify, +info window, plan outputs), can be used for activating/deactivating as well as showing/hiding +can be used for activating/deactivating and hiding, can be used as a comparison and sorting criterion for the +list calculation and is exported to the different lists. +The only difference to the known attributes is the automated generation of the content via a Python script. ## Creation of script-filled attributes @@ -45,21 +45,21 @@ These attributes are created similar to the user-defined attributes in the Attri ![Backup Text](img/auto.jpg "script-filled attributes"){: style="width:700px"} -A created script-filled attribute is available for each element type in cadwork. In the tab "Type -script populated" the evaluation of the script can be limited to single element types. Tjis can be useful if, for example -different evaluations are required for plates and beams. If the evaluation is intended only for elements of the type beam, the content of this +A created script-filled attribute is available for each element type in cadwork. In the tab "Type +script populated" the evaluation of the script can be limited to single element types. Tjis can be useful if, for example +different evaluations are required for plates and beams. If the evaluation is intended only for elements of the type beam, the content of this attribute remains empty for all other element types. If the element type is subsequently changed, a recalculation of the attributes is triggered. ## execution status The execution status of the scripts can be controlled. -The icon for configuring the script-filled attributes is visualized in the Windows menu bar to the left of the message center icon. This display hides a button that can be used to subsequently change the selected status. +The icon for configuring the script-filled attributes is visualized in the Windows menu bar to the left of the message center icon. This display hides a button that can be used to subsequently change the selected status.
![Backup Text](img/auto_button.jpg "script-filled attributes settings"){: style="width:700px"}
## available functions -The available functions are marked in the documentation with an info description. +The available functions are marked in the documentation with an info description. ## example code @@ -72,13 +72,13 @@ import cadwork import attribute_controller import geometry_controller -element_ids = cadwork.get_auto_attribute_elements()#gets the specified element +element_ids = cadwork.get_auto_attribute_elements() # gets the specified element for element_id in element_ids: length = geometry_controller.get_length(element_id) group = attribute_controller.get_group(element_id) result = ' Group:' + group + 'Length:' + str(length) - cadwork.set_auto_attribute([element_id], result)#sets the attribute + cadwork.set_auto_attribute([element_id], result) # sets the attribute ``` ### dimension check @@ -94,8 +94,8 @@ import geometry_controller as gc element_ids = cadwork.get_auto_attribute_elements() for element_id in element_ids: - height = round(gc.get_height(element_id),3) - width = round(gc.get_width(element_id),3) + height = round(gc.get_height(element_id), 3) + width = round(gc.get_width(element_id), 3) if height % 20 == 0 and width % 20 == 0: cadwork.set_auto_attribute([element_id], 'Standard cross-section') else: @@ -104,7 +104,7 @@ for element_id in element_ids: ### concatenate attributes and round dimension -In this example, the attributes name and material are concatenated with the geometric properties width and height. +In this example, the attributes name and material are concatenated with the geometric properties width and height. The width and height are rounded to the nearest 10. ```python title="attributes_dimension.py" @@ -127,7 +127,7 @@ for element_id in element_ids: ### material and storey -Concatenation of the Building Storey with the material. +Concatenation of the Building Storey with the material. ```python title="material_storey.py" import cadwork @@ -142,4 +142,3 @@ for element_id in element_ids: cadwork.set_auto_attribute([element_id], f'{material} - {storey}') ``` - diff --git a/docs/debug.md b/docs/debug.md index 5a68f66..a7596a9 100644 --- a/docs/debug.md +++ b/docs/debug.md @@ -19,7 +19,7 @@ Bugs present in the script can be detected in the console. Any print statements are also visible in the console. ```python -print("hello world") +print('hello world') ``` Print output in console: @@ -55,20 +55,18 @@ or use the debugger from Python IDLE. - Modify the source code file as follows: ```python - import math + # ==============this code added==================================================================: import pydevd_pycharm -pydevd_pycharm.settrace('172.20.208.95', port=12345, stdoutToServer=True, - stderrToServer=True) +pydevd_pycharm.settrace('172.20.208.95', port=12345, stdoutToServer=True, stderrToServer=True) # ================================================================================================ class Solver: - def demo(self, a, b, c): - d = b ** 2 - 4 * a * c + d = b**2 - 4 * a * c if d > 0: disc = math.sqrt(d) root1 = (-b + disc) / (2 * a) @@ -77,18 +75,16 @@ class Solver: elif d == 0: return -b / (2 * a) else: - return "This equation has no roots" + return 'This equation has no roots' if __name__ == '__main__': solver = Solver() while True: - a = int(input("a: ")) - b = int(input("b: ")) - c = int(input("c: ")) + a = int(input('a: ')) + b = int(input('b: ')) + c = int(input('c: ')) result = solver.demo(a, b, c) print(result) - - ``` diff --git a/docs/examples/attribute_example.md b/docs/examples/attribute_example.md index f732711..657fc08 100644 --- a/docs/examples/attribute_example.md +++ b/docs/examples/attribute_example.md @@ -5,26 +5,26 @@ hide: # attribute_controller -## Conditions +## Conditions ```python -import attribute_controller as ac # import module -import element_controller as ec +import attribute_controller as ac # import module +import element_controller as ec # get active element_ids element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: - if ac.is_panel(element_id): # returns boolean - print (True) + if ac.is_panel(element_id): # returns boolean + print(True) else: - print (False) + print(False) ``` ```python import attribute_controller as ac # import module -import element_controller as ec +import element_controller as ec import cadwork @@ -39,54 +39,47 @@ for element_id in element_ids: ## set attributes ```python -import attribute_controller as ac # import module -import element_controller as ec +import attribute_controller as ac # import module +import element_controller as ec element_ids = ec.get_active_identifiable_element_ids() -ac.set_user_attribute_name(11, "ExampleAttribute") -ac.set_user_attribute(element_ids, 11, "Hello World!") +ac.set_user_attribute_name(11, 'ExampleAttribute') +ac.set_user_attribute(element_ids, 11, 'Hello World!') ``` ## get attributes ```python -import attribute_controller as ac # import module -import element_controller as ec +import attribute_controller as ac # import module +import element_controller as ec # get active element_ids element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: - user_attr = ac.get_user_attribute(element_id, 20) # 20 = attribute number + user_attr = ac.get_user_attribute(element_id, 20) # 20 = attribute number user_attr_name = ac.get_user_attribute_name(20) element_guid = ec.get_element_cadwork_guid(element_id) - - print(user_a_name, - user_a, - element_guid - ) + + print(user_a_name, user_a, element_guid) ``` ## assign attributes to beam -```python -import cadwork # import module -import attribute_controller as ac -import element_controller as ec - -point = cadwork.point_3d(100, 200, 300) # create a cadwork Point -vector_x = cadwork.point_3d(1., 0., 0.) # x vector length direction -vector_z = cadwork.point_3d(0., 0., 1.) # z vecotr height orientation -width = 200. # width/heigth of beam section -length = 2600. # beam length -name = 'My first beam :)' # name as a string +```python +import cadwork # import module +import attribute_controller as ac +import element_controller as ec -beam = ec.create_square_beam_vectors(width, length, - point, vector_x, - vector_z) # returns element_id +point = cadwork.point_3d(100, 200, 300) # create a cadwork Point +vector_x = cadwork.point_3d(1.0, 0.0, 0.0) # x vector length direction +vector_z = cadwork.point_3d(0.0, 0.0, 1.0) # z vecotr height orientation +width = 200.0 # width/heigth of beam section +length = 2600.0 # beam length +name = 'My first beam :)' # name as a string -add_beam_name = ac.set_name([beam], name) # input beam id (list), name (string) +beam = ec.create_square_beam_vectors(width, length, point, vector_x, vector_z) # returns element_id +add_beam_name = ac.set_name([beam], name) # input beam id (list), name (string) ``` - diff --git a/docs/examples/bim_example.md b/docs/examples/bim_example.md index 50a39cc..f227a26 100644 --- a/docs/examples/bim_example.md +++ b/docs/examples/bim_example.md @@ -7,7 +7,7 @@ hide: ## get GlobalId (IfcGuid) -```python +```python import cadwork import bim_controller as bc import element_controller as ec @@ -34,7 +34,7 @@ element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: if ac.is_wall(element_id): ifc_type = bc.get_ifc2x3_element_type(element_id) - ifc_type.set_ifc_wall() # notation for setting ifc types + ifc_type.set_ifc_wall() # notation for setting ifc types bc.set_ifc2x3_element_type([element_id], ifc_type) ``` @@ -48,7 +48,6 @@ import element_controller as ec # get active element_ids element_ids = ec.get_active_identifiable_element_ids() bc.set_building_and_storey([element_ids], 'BuildingName', 'Level_1') - ``` ## get Building @@ -64,7 +63,6 @@ element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: bc.get_building(element_id) storey_name = bc.get_storey(element_id) - ``` ## get Storey height @@ -82,7 +80,6 @@ for element_id in element_ids: storey_name = bc.get_storey(element_id) storey_height = bc.get_storey_height(building_name, storey_name) print(storey_height) - ``` ## print IfcType to console @@ -116,4 +113,3 @@ for element in element_ids: if cadwork.ifc_2x3_element_type.is_ifc_member(ifc_type): # do something ``` - diff --git a/docs/examples/cadwork.md b/docs/examples/cadwork.md index c34844d..bd890e6 100644 --- a/docs/examples/cadwork.md +++ b/docs/examples/cadwork.md @@ -7,41 +7,41 @@ hide: ## create a cadwork point -In Python, a cadwork point_3d is represented as a 3D Point structure -> represented by the x, y and z coordinate values of the point. +In Python, a cadwork point_3d is represented as a 3D Point structure -> represented by the x, y and z coordinate values of the point. Find more information about points and vectors in tab geometry examples. ```python -import cadwork # import module +import cadwork # import module -point = cadwork.point_3d(100, 200, 300) # create a cadwork Point +point = cadwork.point_3d(100, 200, 300) # create a cadwork Point ``` -## move a cadwork point +## move a cadwork point -```python -import cadwork # import module +```python +import cadwork # import module -vector_x = cadwork.point_3d(1., 0., 0.) # define vector -distance = 1500.0 # moving distance +vector_x = cadwork.point_3d(1.0, 0.0, 0.0) # define vector +distance = 1500.0 # moving distance -moved_point = point + (vector_x * distance) +moved_point = point + (vector_x * distance) ``` ## distance between two 3D points -```python -import cadwork # import module +```python +import cadwork # import module -point1 = cadwork.point_3d(100, 200, 300) -point2 = cadwork.point_3d(300, 100, 200) +point1 = cadwork.point_3d(100, 200, 300) +point2 = cadwork.point_3d(300, 100, 200) -distance = point1.distance(point2) +distance = point1.distance(point2) ``` ## add 3D points -```python -import cadwork # import module +```python +import cadwork # import module pt1 = cadwork.point_3d(100, 200, 300) @@ -52,31 +52,29 @@ print(pt1) ## process type - ifc2x3 element_type -```python -import cadwork # import module +```python +import cadwork # import module import attribute_controller as ac import bim_controller as bc import element_controller as ec - element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: output_type = ac.get_output_type(element_id) ifc_type = bc.get_ifc2x3_element_type(element_id) - + if cadwork.process_type.is_rough_volume_framed_wall(output_type): ifc_type.set_ifc_wall() bc.set_ifc2x3_element_type([element_id], ifc_type) - ``` ## output type ```python -import element_controller as ec -import attribute_controller as ac -import cadwork +import element_controller as ec +import attribute_controller as ac +import cadwork element_ids = ec.get_active_identifiable_element_ids() @@ -89,9 +87,9 @@ for element in element_ids: ``` ```python -import element_controller as ec -import attribute_controller as ac -import cadwork +import element_controller as ec +import attribute_controller as ac +import cadwork element_ids = ec.get_active_identifiable_element_ids() @@ -101,4 +99,3 @@ for element in element_ids: element_type = ac.get_element_type(element) print(cadwork.element_type.isWall(element_type)) ``` - diff --git a/docs/examples/compare.md b/docs/examples/compare.md index 12beceb..7de78cf 100644 --- a/docs/examples/compare.md +++ b/docs/examples/compare.md @@ -8,27 +8,25 @@ hide: ## compare floats ```python - if __name__ == '__main__': a: float = 1.23 b: float = 1.230000000001 - print("numbers are equal") if (a == b) else print("numbers are different") + print('numbers are equal') if (a == b) else print('numbers are different') result: bool = abs(a - b) < 1e-4 print(result) - ``` ## compare strings ```python if __name__ == '__main__': - print("cadwork" == "cadwork") - print("Cadwork" < "cadwork") - print("Cadwork" > "cadwork") - print("cadwork" != "cadwork") + print('cadwork' == 'cadwork') + print('Cadwork' < 'cadwork') + print('Cadwork' > 'cadwork') + print('cadwork' != 'cadwork') -#output +# output # True # True # False @@ -40,6 +38,7 @@ if __name__ == '__main__': ```python import dataclasses + # value class @dataclasses.dataclass() class Address: @@ -50,9 +49,8 @@ class Address: def __eq__(self, other): if not isinstance(other, Address): return False - return self.street == other.street \ - and self.number == other.number \ - and self.zipcode == other.zipcode + return self.street == other.street and self.number == other.number and self.zipcode == other.zipcode + # entity class class Person: @@ -71,15 +69,14 @@ class Person: if __name__ == '__main__': - address1 = Address(street="ThisStreet", number=20, zipcode=8084) - address2 = Address(street="OtherStreet", number=204, zipcode=9000) + address1 = Address(street='ThisStreet', number=20, zipcode=8084) + address2 = Address(street='OtherStreet', number=204, zipcode=9000) print(address1 == address2) - person1 = Person(name="John", passport_id=123456, address=address1) - person2 = Person(name="John", passport_id=123456, address=address2) + person1 = Person(name='John', passport_id=123456, address=address1) + person2 = Person(name='John', passport_id=123456, address=address2) print(person1 == person2) print(person1.__hash__() == person2.__hash__()) - ``` diff --git a/docs/examples/connector_example.md b/docs/examples/connector_example.md index e278be6..103514e 100644 --- a/docs/examples/connector_example.md +++ b/docs/examples/connector_example.md @@ -7,8 +7,8 @@ hide: ## check if axis are valid -```python -import cadwork # import module +```python +import cadwork # import module import attribute_controller as ac import connector_axis_controller as ca import element_controller as ec @@ -18,14 +18,14 @@ element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: if ac.is_connector_axis(element_id): if ca.check_axis(element_id) == False: - print(f"Element {element_id} has invlid axis") + print(f'Element {element_id} has invlid axis') ``` ## check settings - ignore vba calculation -```python -import attribute_controller as ac # import module -import cadwork -import element_controller as ec +```python +import attribute_controller as ac # import module +import cadwork +import element_controller as ec import visualization_controller as vc element_ids = ec.get_active_identifiable_element_ids() @@ -33,6 +33,4 @@ element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: if ac.get_ignore_in_vba_calculation(element_id): vc.set_color([element_id], 90) - ``` - diff --git a/docs/examples/element_example.md b/docs/examples/element_example.md index 1c38707..5241674 100644 --- a/docs/examples/element_example.md +++ b/docs/examples/element_example.md @@ -7,39 +7,37 @@ hide: ## create_node -```python -import cadwork # import module -import element_controller as ec +```python +import cadwork # import module +import element_controller as ec -point = cadwork.point_3d(100, 200, 300) # create a cadwork Point +point = cadwork.point_3d(100, 200, 300) # create a cadwork Point node = ec.create_node(point) ``` ## create_square_beam_vectors -```python -import cadwork # import module -import element_controller as ec - -point = cadwork.point_3d(100, 200, 300) # create a cadwork Point -vector_x = cadwork.point_3d(1., 0., 0.) # x vector length direction -vector_z = cadwork.point_3d(0., 0., 1.) # z vecotr height orientation -width = 200. # width/heigth of beam section -length = 2600. # beam length - -beam = ec.create_square_beam_vectors(width, length, - point, vector_x, - vector_z) # returns element_id +```python +import cadwork # import module +import element_controller as ec + +point = cadwork.point_3d(100, 200, 300) # create a cadwork Point +vector_x = cadwork.point_3d(1.0, 0.0, 0.0) # x vector length direction +vector_z = cadwork.point_3d(0.0, 0.0, 1.0) # z vecotr height orientation +width = 200.0 # width/heigth of beam section +length = 2600.0 # beam length + +beam = ec.create_square_beam_vectors(width, length, point, vector_x, vector_z) # returns element_id ``` ## stretch facet -```python -import element_controller as ec # import module +```python +import element_controller as ec # import module import cadwork import geometry_controller as gc element_ids = ec.get_active_identifiable_element_ids() -distance = 75. +distance = 75.0 for element_id in element_ids: xl = gc.get_xl(element_id) * distance @@ -57,6 +55,5 @@ element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: facets = gc.get_element_facets(element_id) for facet in facets: - ec.create_surface(facet) # create surface + ec.create_surface(facet) # create surface ``` - diff --git a/docs/examples/endtype_example.md b/docs/examples/endtype_example.md index 6ec86cd..b221763 100644 --- a/docs/examples/endtype_example.md +++ b/docs/examples/endtype_example.md @@ -7,8 +7,8 @@ hide: ## get endtype name at start point of the element -```python -import cadwork # import module +```python +import cadwork # import module import endtype_controller as etc import element_controller as ec @@ -21,22 +21,21 @@ for element_id in element_ids: ## get endtype name at start point of the element -```python -import cadwork # import module +```python +import cadwork # import module import endtype_controller as etc import element_controller as ec import utility_controller as uc element_ids = ec.get_active_identifiable_element_ids() -new_endtype = uc.get_user_string("name of the new end-type") +new_endtype = uc.get_user_string('name of the new end-type') i = 0 for element_id in element_ids: endtype_name = etc.get_endtype_name_start(element_id) - if endtype_name == "V_8": # V_8 = name of an endtpye + if endtype_name == 'V_8': # V_8 = name of an endtpye etc.set_endtype_name_start(element_id, new_endtype) i += 1 -uc.print_error("Number of end-type replaced:%d" % i) +uc.print_error('Number of end-type replaced:%d' % i) ``` - diff --git a/docs/examples/file_example.md b/docs/examples/file_example.md index a961a6c..af01d18 100644 --- a/docs/examples/file_example.md +++ b/docs/examples/file_example.md @@ -7,20 +7,19 @@ hide: ## Export Rhino File -```python -import file_controller as fc # import module +```python +import file_controller as fc # import module import element_controller as ec element_ids = ec.get_active_identifiable_element_ids() # list: aElementIdList, str: aFilePath, int: aVersion, bool: aUseDefaultAssignment, bool: aWriteStandardAttributes -fc.export_rhino_file(element_ids, "C:\Downloads\RhinoExport.3dm", 6, True, True) - +fc.export_rhino_file(element_ids, 'C:\Downloads\RhinoExport.3dm', 6, True, True) ``` ## Export Rhino File - create directory ```python -import file_controller as fc +import file_controller as fc import element_controller as ec import os @@ -28,12 +27,12 @@ target_path = 'C:\\Users\\YourUsername\\Downloads\\RhinoExports\\' try: create_direction = os.mkdir(target_path) - # replace YourUsername with your username on your PC or add another directory + # replace YourUsername with your username on your PC or add another directory # mkdir will create a folder with the Name RhinoExports -except FileExistsError: # excepiton handling - if folder exists - print("Folder already exists!") +except FileExistsError: # excepiton handling - if folder exists + print('Folder already exists!') -# path to the new file +# path to the new file file_name = target_path + 'TestExport.3dm' @@ -44,13 +43,11 @@ fc.export_rhino_file(element_ids, file_name, 6, True, True) ## Import Step File -```python -import file_controller as fc # import module +```python +import file_controller as fc # import module import element_controller as ec -import_file = uc.get_new_user_file_from_dialog("*.stp") +import_file = uc.get_new_user_file_from_dialog('*.stp') # str: aFilePath, float: aScale, bool: aMesageOption fc.import_step_file_with_message_option(import_file, 0.0001, True) - ``` - diff --git a/docs/examples/geometry.md b/docs/examples/geometry.md index 1223260..37f1a83 100644 --- a/docs/examples/geometry.md +++ b/docs/examples/geometry.md @@ -84,7 +84,7 @@ print(point.z) # prints z coordinate ### point_3d Methods -```python +```python point_3d + point_3d point_3d - point_3d point_3d * float @@ -97,7 +97,7 @@ point_3d /= float point_3d == point_3d point_3d != point_3d point_3d.dot(point_3d) # dot product or scalar product -point_3d.cross(point_3d) # cross product or vector product +point_3d.cross(point_3d) # cross product or vector product point_3d.magnitude() # vector magnitude or length point_3d.normalized() # a normalized vector maintains its direction but its length becomes 1 point_3d.distance(point_3d) # distance between two points @@ -109,13 +109,13 @@ point_3d.distance(point_3d) # distance between two points ![Move Point](../img/move_pt.png){width=300} -```python +```python import cadwork # import module -vector_x = cadwork.point_3d(1., 0., 0.) # define vector +vector_x = cadwork.point_3d(1.0, 0.0, 0.0) # define vector distance = 1500.0 # moving distance -moved_point = point + (vector_x * distance) +moved_point = point + (vector_x * distance) ``` ### cross product @@ -127,8 +127,8 @@ moved_point = point + (vector_x * distance) ```python import cadwork -a = cadwork.point_3d(1., 0., 0.) -b = cadwork.point_3d(0., 1., 0.) +a = cadwork.point_3d(1.0, 0.0, 0.0) +b = cadwork.point_3d(0.0, 1.0, 0.0) ab = a.cross(b) # ab = [0.000000, 0.000000, 1.000000] @@ -141,11 +141,10 @@ $$ $$ ```python -import math as m # import module +import math as m # import module import cadwork as cw def angle_between_vectors(v1: cw.point_3d, v2: cw.point_3d) -> float: return m.acos(v1.dot(v2) / (v1.magnitude() * v2.magnitude())) * (180 / m.pi) -``` - +``` diff --git a/docs/examples/geometry_example.md b/docs/examples/geometry_example.md index 07370fd..1a738f0 100644 --- a/docs/examples/geometry_example.md +++ b/docs/examples/geometry_example.md @@ -6,30 +6,28 @@ hide: # geometry_controller ## get beam points and vetors -```python -import cadwork # import module -import element_controller as ec -import geometry_controller as gc +```python +import cadwork # import module +import element_controller as ec +import geometry_controller as gc # get active element_ids element_ids = ec.get_active_identifiable_element_ids() for element_id in element_ids: - vector_x = gc.get_xl(element_id) # returns local vector - vector_y = gc.get_yl(element_id) # returns local vector - vector_z = gc.get_zl(element_id) # returns local vector - get_p1 = gc.get_p1(element_id) # returns cartesian point - get_p2 = gc.get_p2(element_id) # returns cartesian point - get_p3 = gc.get_p3(element_id) # returns cartesian point + vector_x = gc.get_xl(element_id) # returns local vector + vector_y = gc.get_yl(element_id) # returns local vector + vector_z = gc.get_zl(element_id) # returns local vector + get_p1 = gc.get_p1(element_id) # returns cartesian point + get_p2 = gc.get_p2(element_id) # returns cartesian point + get_p3 = gc.get_p3(element_id) # returns cartesian point print(f"""the elements local vecotr z is: {vector_z} \n' the coordinates of the point_3 are {get_p3}""") - - ``` ## filter elements according to a limit value -```python +```python import attribute_controller as ac import element_controller as ec import cadwork @@ -38,15 +36,14 @@ import geometry_controller as gc element_ids = ec.get_active_identifiable_element_ids() # max area -area = 1500000. +area = 1500000.0 -# list comprehension -filtered_ids = [element for element in element_ids if ac.is_panel(element) - and gc.get_element_reference_face_area(element) < area] +# list comprehension +filtered_ids = [ + element for element in element_ids if ac.is_panel(element) and gc.get_element_reference_face_area(element) < area +] value = 'area smaller than ' -ac.set_user_attribute(filtered_ids, 10, f'{value, area} mm2' ) - - +ac.set_user_attribute(filtered_ids, 10, f'{value, area} mm2') ``` diff --git a/docs/examples/list_example.md b/docs/examples/list_example.md index 81b482e..5a9d5d1 100644 --- a/docs/examples/list_example.md +++ b/docs/examples/list_example.md @@ -6,7 +6,7 @@ hide: # list_controller ## check production list discrepancies -```python +```python import cadwork import list_controller as lc import utility_controller as uc @@ -16,17 +16,16 @@ import visualization_controller as vc checked_element_ids = lc.check_position_numbers_production_list() if not checked_element_ids: - uc.print_error("No discrepancies in production list") + uc.print_error('No discrepancies in production list') else: vc.set_active(checked_element_ids) - uc.print_error("Active elements have discrepancies in the production list !") - + uc.print_error('Active elements have discrepancies in the production list !') ``` -## export part list +## export part list -```python +```python import cadwork import list_controller as lc import utility_controller as uc @@ -34,6 +33,4 @@ import visualization_controller as vc element_ids = ec.get_active_identifiable_element_ids() lc.export_part_list(element_ids, 'C:\\Downloads\\api_list.cwlm') - ``` - diff --git a/docs/examples/machine_example.md b/docs/examples/machine_example.md index e8866c2..c9f3f7a 100644 --- a/docs/examples/machine_example.md +++ b/docs/examples/machine_example.md @@ -6,23 +6,21 @@ hide: # machine_controller ## check production list discrepancies -```python +```python import machine_controller as mac import cadwork -btl_enum = 5 # VERSION: "BTL V10.6" +btl_enum = 5 # VERSION: "BTL V10.6" # The enumeration is done according to the machine export listing in the export menu. -file_path = 'C:\\Downloads\\api_btl.btl' +file_path = 'C:\\Downloads\\api_btl.btl' mac.export_btl(btl_enum, file_path) - ``` -```python +```python import machine_controller as mac import cadwork -hundegger_enum = 3 # Hundegger K2 +hundegger_enum = 3 # Hundegger K2 # The enumeration is done according to the machine export listing in the export menu. mac.export_hundegger(hundegger_enum) - ``` diff --git a/docs/examples/material_example.md b/docs/examples/material_example.md index 23ed637..4f216e8 100644 --- a/docs/examples/material_example.md +++ b/docs/examples/material_example.md @@ -4,9 +4,9 @@ hide: --- # material_controller -## get material ids and names +## get material ids and names -```python +```python import cadwork import material_controller as mc @@ -14,19 +14,16 @@ material_ids_by_name = {} for material_id in mc.get_all_materials(): mat_name = mc.get_name(material_id) material_ids_by_name[mat_name] = material_id - ``` ## create new material -```python +```python import material_controller as mc - + material_id = mc.create_material('Cross-Laminated-Timber') # the new created material is stored in the category "No groups" mc.set_group(material_id, 'Plattenwerkstoffe') # the new created material is now shifted in the category "Plattenwerkstoffe" - ``` - diff --git a/docs/examples/menu_example.md b/docs/examples/menu_example.md index 2104a98..10210fe 100644 --- a/docs/examples/menu_example.md +++ b/docs/examples/menu_example.md @@ -4,10 +4,10 @@ hide: --- # menu_controller -## create a simple cadwork menu +## create a simple cadwork menu -```python -import menu_controller as mec +```python +import menu_controller as mec import utility_controller as uc import cadwork @@ -18,16 +18,15 @@ while True: if menu == 'Foo': uc.print_error('You pressed Foo') - + elif menu == 'Bar': uc.print_error('You pressed Bar') - + elif menu == 'Baz': uc.print_error('You pressed Baz') - + elif menu == 'Return': break - ``` Above code generates a menu structure like this. @@ -38,7 +37,6 @@ Above code generates a menu structure like this. ## Process type setter ```python - import cadwork as cw import attribute_controller as ac import element_controller as ec @@ -48,67 +46,70 @@ import menu_controller as mc def list_ele_types(ele_type): - l_ele_types = [[cw.element_type.is_additional_element(ele_type), 'is_additional_element'], - [cw.element_type.is_auxiliary(ele_type), 'is_auxiliary'], - [cw.element_type.is_cadwork(ele_type), 'is_cadwork'], - [cw.element_type.is_circular_axis(ele_type), 'is_circular_axis'], - [cw.element_type.is_circular_beam(ele_type), 'is_circular_beam'], - [cw.element_type.is_connector_axis(ele_type), 'is_connector_axis'], - [cw.element_type.is_connector_node(ele_type), 'is_connector_node'], - [cw.element_type.is_container(ele_type), 'is_container'], - [cw.element_type.is_dimension(ele_type), 'is_dimension'], - [cw.element_type.is_drilling_axis(ele_type), 'is_drilling_axis'], - [cw.element_type.is_eave_axis(ele_type), 'is_eave_axis'], - [cw.element_type.is_export_solid(ele_type), 'is_export_solid'], - [cw.element_type.is_export_solid_scene(ele_type), 'is_export_solid_scene'], - [cw.element_type.is_floor(ele_type), 'is_floor'], - [cw.element_type.is_global_cut(ele_type), 'is_global_cut'], - [cw.element_type.is_graphical_object(ele_type), 'is_graphical_object'], - [cw.element_type.is_line(ele_type), 'is_line'], - [cw.element_type.is_nesting_parent(ele_type), 'is_nesting_parent'], - [cw.element_type.is_none(ele_type), 'is_none'], - [cw.element_type.is_normal_node(ele_type), 'is_normal_node'], - [cw.element_type.is_opening(ele_type), 'is_opening'], - [cw.element_type.is_panel(ele_type), 'is_panel'], - [cw.element_type.is_rectangular_axis(ele_type), 'is_rectangular_axis'], - [cw.element_type.is_rectangular_beam(ele_type), 'is_rectangular_beam'], - [cw.element_type.is_roof(ele_type), 'is_roof'], - [cw.element_type.is_room(ele_type), 'is_room'], - [cw.element_type.is_rotation_element(ele_type), 'is_rotation_element'], - [cw.element_type.is_section_trace(ele_type), 'is_section_trace'], - [cw.element_type.is_steel_shape(ele_type), 'is_steel_shape'], - [cw.element_type.is_surface(ele_type), 'is_surface'], - [cw.element_type.is_text_document(ele_type), 'is_text_document'], - [cw.element_type.is_wall(ele_type), 'is_wall'], - [cw.element_type.is_wire_axis(ele_type), 'is_wire_axis']] + l_ele_types = [ + [cw.element_type.is_additional_element(ele_type), 'is_additional_element'], + [cw.element_type.is_auxiliary(ele_type), 'is_auxiliary'], + [cw.element_type.is_cadwork(ele_type), 'is_cadwork'], + [cw.element_type.is_circular_axis(ele_type), 'is_circular_axis'], + [cw.element_type.is_circular_beam(ele_type), 'is_circular_beam'], + [cw.element_type.is_connector_axis(ele_type), 'is_connector_axis'], + [cw.element_type.is_connector_node(ele_type), 'is_connector_node'], + [cw.element_type.is_container(ele_type), 'is_container'], + [cw.element_type.is_dimension(ele_type), 'is_dimension'], + [cw.element_type.is_drilling_axis(ele_type), 'is_drilling_axis'], + [cw.element_type.is_eave_axis(ele_type), 'is_eave_axis'], + [cw.element_type.is_export_solid(ele_type), 'is_export_solid'], + [cw.element_type.is_export_solid_scene(ele_type), 'is_export_solid_scene'], + [cw.element_type.is_floor(ele_type), 'is_floor'], + [cw.element_type.is_global_cut(ele_type), 'is_global_cut'], + [cw.element_type.is_graphical_object(ele_type), 'is_graphical_object'], + [cw.element_type.is_line(ele_type), 'is_line'], + [cw.element_type.is_nesting_parent(ele_type), 'is_nesting_parent'], + [cw.element_type.is_none(ele_type), 'is_none'], + [cw.element_type.is_normal_node(ele_type), 'is_normal_node'], + [cw.element_type.is_opening(ele_type), 'is_opening'], + [cw.element_type.is_panel(ele_type), 'is_panel'], + [cw.element_type.is_rectangular_axis(ele_type), 'is_rectangular_axis'], + [cw.element_type.is_rectangular_beam(ele_type), 'is_rectangular_beam'], + [cw.element_type.is_roof(ele_type), 'is_roof'], + [cw.element_type.is_room(ele_type), 'is_room'], + [cw.element_type.is_rotation_element(ele_type), 'is_rotation_element'], + [cw.element_type.is_section_trace(ele_type), 'is_section_trace'], + [cw.element_type.is_steel_shape(ele_type), 'is_steel_shape'], + [cw.element_type.is_surface(ele_type), 'is_surface'], + [cw.element_type.is_text_document(ele_type), 'is_text_document'], + [cw.element_type.is_wall(ele_type), 'is_wall'], + [cw.element_type.is_wire_axis(ele_type), 'is_wire_axis'], + ] return l_ele_types def list_process_types_is(process_type): - l_process_types_i = [[cw.process_type.is_hip_valley(process_type), 'is_hip_valley'], - [cw.process_type.is_jack_rafter(process_type), 'is_jack_rafter'], - [cw.process_type.is_log(process_type), 'is_log'], - [cw.process_type.is_none(process_type), 'is_none'], - [cw.process_type.is_panel_1(process_type), 'is_panel_1'], - [cw.process_type.is_panel_2(process_type), 'is_panel_2'], - [cw.process_type.is_panel_3(process_type), 'is_panel_3'], - [cw.process_type.is_panel_4(process_type), 'is_panel_4'], - [cw.process_type.is_panel_5(process_type), 'is_panel_5'], - [cw.process_type.is_purlin(process_type), 'is_purlin'], - [cw.process_type.is_rafter(process_type), 'is_rafter'], - [cw.process_type.is_rough_volume_framed_wall(process_type), 'is_rough_volume_framed_wall'], - [cw.process_type.is_rough_volume_log_home(process_type), 'is_rough_volume_log_home'], - [cw.process_type.is_rough_volume_solid_wood_wall(process_type), - 'is_rough_volume_solid_wood_wall'], - [cw.process_type.is_stud(process_type), 'is_stud'], - [cw.process_type.is_tread(process_type), 'is_tread'], - [cw.process_type.is_truss(process_type), 'is_truss'], - [cw.process_type.is_user_1(process_type), 'is_user_1'], - [cw.process_type.is_user_2(process_type), 'is_user_2'], - [cw.process_type.is_user_3(process_type), 'is_user_3'], - [cw.process_type.is_user_4(process_type), 'is_user_4'], - [cw.process_type.is_user_5(process_type), 'is_user_5'], - [cw.process_type.is_user_5(process_type), 'is_user_5']] + l_process_types_i = [ + [cw.process_type.is_hip_valley(process_type), 'is_hip_valley'], + [cw.process_type.is_jack_rafter(process_type), 'is_jack_rafter'], + [cw.process_type.is_log(process_type), 'is_log'], + [cw.process_type.is_none(process_type), 'is_none'], + [cw.process_type.is_panel_1(process_type), 'is_panel_1'], + [cw.process_type.is_panel_2(process_type), 'is_panel_2'], + [cw.process_type.is_panel_3(process_type), 'is_panel_3'], + [cw.process_type.is_panel_4(process_type), 'is_panel_4'], + [cw.process_type.is_panel_5(process_type), 'is_panel_5'], + [cw.process_type.is_purlin(process_type), 'is_purlin'], + [cw.process_type.is_rafter(process_type), 'is_rafter'], + [cw.process_type.is_rough_volume_framed_wall(process_type), 'is_rough_volume_framed_wall'], + [cw.process_type.is_rough_volume_log_home(process_type), 'is_rough_volume_log_home'], + [cw.process_type.is_rough_volume_solid_wood_wall(process_type), 'is_rough_volume_solid_wood_wall'], + [cw.process_type.is_stud(process_type), 'is_stud'], + [cw.process_type.is_tread(process_type), 'is_tread'], + [cw.process_type.is_truss(process_type), 'is_truss'], + [cw.process_type.is_user_1(process_type), 'is_user_1'], + [cw.process_type.is_user_2(process_type), 'is_user_2'], + [cw.process_type.is_user_3(process_type), 'is_user_3'], + [cw.process_type.is_user_4(process_type), 'is_user_4'], + [cw.process_type.is_user_5(process_type), 'is_user_5'], + [cw.process_type.is_user_5(process_type), 'is_user_5'], + ] return l_process_types_i @@ -161,17 +162,36 @@ def list_process_types_set(z, process_type): return process_type - def menu_output_type(): - menu_items = ['hip_valley', 'jack_rafter', 'log', 'none', 'panel_1', 'panel_2', 'panel_3', - 'panel_4', 'panel_5', 'purlin', 'rafter', 'rough_volume_framed_wall', 'rough_volume_log_home', - 'rough_volume_solid_wood_wall', 'stud', 'tread', 'truss', 'user_1', 'user_2', 'user_3', - 'user_4', 'user_5'] + menu_items = [ + 'hip_valley', + 'jack_rafter', + 'log', + 'none', + 'panel_1', + 'panel_2', + 'panel_3', + 'panel_4', + 'panel_5', + 'purlin', + 'rafter', + 'rough_volume_framed_wall', + 'rough_volume_log_home', + 'rough_volume_solid_wood_wall', + 'stud', + 'tread', + 'truss', + 'user_1', + 'user_2', + 'user_3', + 'user_4', + 'user_5', + ] menu_select = mc.display_simple_menu(menu_items) menu_i = menu_items.index(menu_select) - return menu_i+1 + return menu_i + 1 def main(): @@ -186,12 +206,12 @@ def main(): for p_type in l_process_types: if p_type[0]: - for e_type in l_ele_types: - if e_type[0]: - vc.hide_all_elements() - vc.set_visible([element]) - vc.zoom_all_elements() - uc.print_error(f'Elementyp = {e_type[1]} / Ausgabeart = {p_type[1]}') + for e_type in l_ele_types: + if e_type[0]: + vc.hide_all_elements() + vc.set_visible([element]) + vc.zoom_all_elements() + uc.print_error(f'Elementyp = {e_type[1]} / Ausgabeart = {p_type[1]}') n_process_type = list_process_types_set(menu_output_type(), process_type) ac.set_output_type([element], n_process_type) @@ -204,6 +224,4 @@ def main(): if __name__ == '__main__': main() - ``` - diff --git a/docs/examples/scene_example.md b/docs/examples/scene_example.md index bb63547..5874f62 100644 --- a/docs/examples/scene_example.md +++ b/docs/examples/scene_example.md @@ -6,7 +6,7 @@ hide: # scene_controller ## create and add elements to scene -```python +```python import element_controller as ec import cadwork import scene_controller as sc @@ -17,12 +17,11 @@ new_scene = sc.add_scene('NewScene') if new_scene: sc.add_elements_to_scene('NewScene', element_ids) sc.activate_scene('NewScene') - ``` ## get elements from scene -```python +```python element_ids_scene = sc.get_elements_from_scene('NewScene') element_subgroup_scene = [] @@ -33,5 +32,4 @@ for element_id in element_ids_scene: print(len(element_ids_scene)) print(set(element_subgroup_scene)) - ``` diff --git a/docs/examples/shop_drawing_example.md b/docs/examples/shop_drawing_example.md index 7f3e4b4..aebcfa2 100644 --- a/docs/examples/shop_drawing_example.md +++ b/docs/examples/shop_drawing_example.md @@ -6,20 +6,19 @@ hide: # shop_drawing_controller ## export 2d wireframe drawing from current view -```python +```python import cadwork import shop_drawing_controller as sdc clipboard_number = 3 -with_layout = False # boolean to export with or without layout +with_layout = False # boolean to export with or without layout sdc.export_2d_wireframe_with_clipboard(clipboard_number, with_layout) - ``` ## export 2d wireframe drawing from current view -```python +```python import attribute_controller as ac import cadwork import geometry_controller as gc @@ -33,13 +32,11 @@ if len(element_id) != 1: if not ac.is_wall(*element_id): uc.print_error('Please select a wall element') exit() - + position_vector = gc.get_p1(*element_id) -position_vector += (gc.get_xl(*element_id) * 500.) +position_vector += gc.get_xl(*element_id) * 500.0 sdc.add_wall_section_vertical(*element_id, position_vector) - ``` ![Backup Text](../img/section.png "Example Menu"){: style="width:600px"} - diff --git a/docs/examples/tk_gui.md b/docs/examples/tk_gui.md index 16c5493..126d0ac 100644 --- a/docs/examples/tk_gui.md +++ b/docs/examples/tk_gui.md @@ -20,6 +20,7 @@ Tkinter is not a thin wrapper, but adds a fair amount of its own logic to make t ```python import tkinter as tk + class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) @@ -29,16 +30,16 @@ class Application(tk.Frame): def create_widgets(self): self.hi_there = tk.Button(self) - self.hi_there["text"] = "Hello cadwork World\n(click me)" - self.hi_there["command"] = self.say_hi - self.hi_there.pack(side="top") + self.hi_there['text'] = 'Hello cadwork World\n(click me)' + self.hi_there['command'] = self.say_hi + self.hi_there.pack(side='top') - self.quit = tk.Button(self, text="QUIT", fg="blue", - command=self.master.destroy) - self.quit.pack(side="bottom") + self.quit = tk.Button(self, text='QUIT', fg='blue', command=self.master.destroy) + self.quit.pack(side='bottom') def say_hi(self): - print("hi there, everyone!") + print('hi there, everyone!') + root = tk.Tk() app = Application(master=root) @@ -50,32 +51,34 @@ app.mainloop() ```python import tkinter as tk + class MyApp(tk.Frame): def __init__(self, master=None): super().__init__(master) self.pack() - + self.ok = tk.Button(self) - self.ok["text"] = "cadwork" - self.ok["command"] = self.handler + self.ok['text'] = 'cadwork' + self.ok['command'] = self.handler self.ok.pack() - + def handler(self): - print("Button clicked") + print('Button clicked') -if __name__ == "__main__": +if __name__ == '__main__': root = tk.Tk() - root.geometry("500x300") + root.geometry('500x300') app = MyApp(root) app.mainloop() -``` +``` ### Coupling Widget Variables ```python import tkinter as tk + class App(tk.Frame): def __init__(self, master): super().__init__(master) @@ -87,18 +90,17 @@ class App(tk.Frame): # Create the application variable. self.contents = tk.StringVar() # Set it to some value. - self.contents.set("this is a variable") + self.contents.set('this is a variable') # Tell the entry widget to watch this variable. - self.entrythingy["textvariable"] = self.contents + self.entrythingy['textvariable'] = self.contents # Define a callback for when the user hits return. # It prints the current value of the variable. - self.entrythingy.bind('', - self.print_contents) + self.entrythingy.bind('', self.print_contents) def print_contents(self, event): - print("Hi. The current entry content is:", - self.contents.get()) + print('Hi. The current entry content is:', self.contents.get()) + root = tk.Tk() myapp = App(root) @@ -107,12 +109,10 @@ myapp.mainloop() # PyQt 5 ```python -from PyQt5.QtWidgets import (QWidget, QToolTip, - QPushButton, QApplication, - QLabel) +from PyQt5.QtWidgets import QWidget, QToolTip, QPushButton, QApplication, QLabel -class MyWindow(QWidget): +class MyWindow(QWidget): def __init__(self): super().__init__() self.initUI() @@ -125,8 +125,8 @@ class MyWindow(QWidget): self.setGeometry(300, 300, 300, 200) self.setWindowTitle('Qt5 Button') + if __name__ == '__main__': window = MyWindow() window.show() ``` - diff --git a/docs/examples/utility_example.md b/docs/examples/utility_example.md index 93d09d8..d0889ea 100644 --- a/docs/examples/utility_example.md +++ b/docs/examples/utility_example.md @@ -8,7 +8,7 @@ hide: Speed up the process within cadwork by disabling the display refresh. -```python +```python import cadwork import utility_controller as uc import element_controller as ec @@ -22,8 +22,9 @@ uc.disable_auto_display_refresh() drillings = [] points_range = range(1, 15000, 120) for p in points_range: - drillings.append(ec.create_drilling_vectors(40, 50, - cadwork.point_3d(p, 0., 0.), cadwork.point_3d(0., 0., -1.))) + drillings.append( + ec.create_drilling_vectors(40, 50, cadwork.point_3d(p, 0.0, 0.0), cadwork.point_3d(0.0, 0.0, -1.0)) + ) vc.set_color(drillings, 5) @@ -31,28 +32,22 @@ uc.enable_auto_display_refresh() ec.recreate_elements(drillings) end = timer() -print(timedelta(seconds=end-start)) +print(timedelta(seconds=end - start)) # measuring time in seconds when disable display refresh 0:00:00.057018s # without disabling, the exucation duration is 0:00:01.831747s - ``` ## user interactions -```python +```python import cadwork import utility_controller as uc import element_controller as ec -drill_bool = uc.get_user_bool("Do u want to create a drilling ?", True) +drill_bool = uc.get_user_bool('Do u want to create a drilling ?', True) if drill_bool: pt = uc.get_user_point() length = uc.get_user_double('Enter the drilling length') - drilling = ec.create_drilling_vectors(40, length, pt, cadwork.point_3d(0., 0., -1.)) - + drilling = ec.create_drilling_vectors(40, length, pt, cadwork.point_3d(0.0, 0.0, -1.0)) ``` - - - - diff --git a/docs/examples/visualization_example.md b/docs/examples/visualization_example.md index 88e8b25..922efc0 100644 --- a/docs/examples/visualization_example.md +++ b/docs/examples/visualization_example.md @@ -5,37 +5,33 @@ hide: # visualization_controller ## assign color to beam -```python -import cadwork # import module -import element_controller as ec -import visualization_controller as vc - -point = cadwork.point_3d(100, 200, 300) # create a cadwork Point -vector_x = cadwork.point_3d(1., 0., 0.) # x vector length direction -vector_z = cadwork.point_3d(0., 0., 1.) # z vecotr height orientation -width = 200. # width/heigth of beam section -length = 2600. # beam length -color = 3 # color number as an int - -beam = ec.create_square_beam_vectors(width, length, - point, vector_x, - vector_z) # returns element_id - -add_beam_color = vc.set_color([beam], color) # input beam id (list), color (int) +```python +import cadwork # import module +import element_controller as ec +import visualization_controller as vc + +point = cadwork.point_3d(100, 200, 300) # create a cadwork Point +vector_x = cadwork.point_3d(1.0, 0.0, 0.0) # x vector length direction +vector_z = cadwork.point_3d(0.0, 0.0, 1.0) # z vecotr height orientation +width = 200.0 # width/heigth of beam section +length = 2600.0 # beam length +color = 3 # color number as an int + +beam = ec.create_square_beam_vectors(width, length, point, vector_x, vector_z) # returns element_id + +add_beam_color = vc.set_color([beam], color) # input beam id (list), color (int) ``` ## mutable - immutable -```python +```python import cadwork import element_controller as ec import visualization_controller as vc element_ids = ec.get_active_identifiable_element_ids() -immutable = uc.get_user_bool("Do you want to set the elements to immutable ?", True) +immutable = uc.get_user_bool('Do you want to set the elements to immutable ?', True) if immutable: vc.set_immutable(element_ids) - ``` - diff --git a/docs/modules.md b/docs/modules.md index e338f6c..236d5ae 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -8,14 +8,15 @@ hide: !!! important "The module cadwork is to be loaded into the namespace at any time. This module is needed for many processes.
```import cadwork``` " **Import packages**
-As CPython is used in cadwork, it is possible to work with external modules. The modules included in Python as standard can be integrated normally by loading the modules. +As CPython is used in cadwork, it is possible to work with external modules. The modules included in Python as standard can be integrated normally by loading the modules. ```python # import modules -import cadwork -import math -import csv -import tkinter +import cadwork +import math +import csv +import tkinter + ... ... ``` @@ -26,26 +27,26 @@ For external modules, their path variable must be added to the system. sys.path in Python -Sys is a built-in Python module that contains parameters specific to the system i.e. it contains variables and methods that interact with the interpreter and are also governed by it. +Sys is a built-in Python module that contains parameters specific to the system i.e. it contains variables and methods that interact with the interpreter and are also governed by it. sys.path -sys.path is a built-in variable within the sys module. It contains a list of directories that the interpreter will search in for the required module. +sys.path is a built-in variable within the sys module. It contains a list of directories that the interpreter will search in for the required module. When a module(a module is a python file) is imported within a Python file, the interpreter first searches for the specified module among its built-in modules. If not found it looks through the list of directories(a directory is a folder that contains related modules) defined by sys.path. source: [GeeksforGeeks](https://www.geeksforgeeks.org/sys-path-in-python/) -Initializing sys.path +Initializing sys.path By default, the interpreter looks for a module within the current directory. To make the interpreter search in some other directory **you just simply have to change the current directory**. The following example depicts a default path taken by the interpreter: ```python # import modules -import sys -import utility_controller as uc +import sys +import utility_controller as uc # get userprofil path -USERPROFIL = uc.get_3d_userprofil_path() +USERPROFIL = uc.get_3d_userprofil_path() # appending a path sys.path.append(USERPROFIL + '\\api.x64\\FolderName\\PackageFolder') @@ -55,7 +56,5 @@ print(sys.path) # import external modules -import PackageFolder - +import PackageFolder ``` - diff --git a/src/attribute_controller/__init__.pyi b/src/attribute_controller/__init__.pyi index 5bc771b..8e37fd7 100644 --- a/src/attribute_controller/__init__.pyi +++ b/src/attribute_controller/__init__.pyi @@ -17,7 +17,6 @@ from cadwork.layer_settings import layer_settings from cadwork.node_symbol import node_symbol from cadwork.process_type import process_type - def set_name(element_id_list: list[ElementId], name: str) -> None: """Sets the element name. @@ -26,7 +25,6 @@ def set_name(element_id_list: list[ElementId], name: str) -> None: name: The element name. """ - def set_group(element_id_list: list[ElementId], group: str) -> None: """Sets the element group. @@ -35,7 +33,6 @@ def set_group(element_id_list: list[ElementId], group: str) -> None: group: The element group. """ - def set_subgroup(element_id_list: list[ElementId], subgroup: str) -> None: """Sets the element subgroup. @@ -44,7 +41,6 @@ def set_subgroup(element_id_list: list[ElementId], subgroup: str) -> None: subgroup: The element subgroup. """ - def set_comment(element_id_list: list[ElementId], comment: str) -> None: """Sets the element comment. @@ -53,7 +49,6 @@ def set_comment(element_id_list: list[ElementId], comment: str) -> None: comment: The element comment. """ - def set_user_attribute(element_id_list: list[ElementId], number: UserAttributeId, user_attribute: str) -> None: """Sets the element user attribute. @@ -63,7 +58,6 @@ def set_user_attribute(element_id_list: list[ElementId], number: UserAttributeId user_attribute: The user attribute. """ - def set_sku(element_id_list: list[ElementId], sku: str) -> None: """Sets the element SKU. @@ -72,7 +66,6 @@ def set_sku(element_id_list: list[ElementId], sku: str) -> None: sku: The element SKU. """ - def set_production_number(element_id_list: list[ElementId], production_number: UnsignedInt) -> None: """Sets the element production number. @@ -81,7 +74,6 @@ def set_production_number(element_id_list: list[ElementId], production_number: U production_number: The element production number. """ - def set_part_number(element_id_list: list[ElementId], part_number: UnsignedInt) -> None: """Sets the element part number. @@ -90,7 +82,6 @@ def set_part_number(element_id_list: list[ElementId], part_number: UnsignedInt) part_number: The element part number. """ - def set_additional_data(element_id_list: list[ElementId], data_id: str, data_text: str) -> None: """Sets the element additional data. @@ -100,7 +91,6 @@ def set_additional_data(element_id_list: list[ElementId], data_id: str, data_tex data_text: The element additional data. """ - def delete_additional_data(element_id_list: list[ElementId], data_id: str) -> None: """Deletes the element additional data. @@ -109,7 +99,6 @@ def delete_additional_data(element_id_list: list[ElementId], data_id: str) -> No data_id: The data id. """ - def set_user_attribute_name(number: UserAttributeId, user_attribute_name: str) -> None: """Sets the user attribute name. @@ -118,7 +107,6 @@ def set_user_attribute_name(number: UserAttributeId, user_attribute_name: str) - user_attribute_name: The user attribute name. """ - def set_process_type_and_extended_settings_from_name(element_id_list: list[ElementId]) -> None: """Sets the element process type and extended settings from the element name. @@ -126,7 +114,6 @@ def set_process_type_and_extended_settings_from_name(element_id_list: list[Eleme element_id_list: The element id list. """ - def set_name_process_type(name: str, process_type: process_type) -> None: """Sets the process type for an element name. @@ -135,7 +122,6 @@ def set_name_process_type(name: str, process_type: process_type) -> None: process_type: The process type. """ - def set_name_extended_settings(name: str, extended_settings: extended_settings) -> None: """Sets the extended settings for an element name. @@ -144,7 +130,6 @@ def set_name_extended_settings(name: str, extended_settings: extended_settings) extended_settings: The extended settings. """ - def set_output_type(element_id_list: list[ElementId], process_type: process_type) -> None: """Sets the element output type. @@ -153,7 +138,6 @@ def set_output_type(element_id_list: list[ElementId], process_type: process_type process_type: The process type. """ - def set_extended_settings(element_id_list: list[ElementId], extended_settings: extended_settings) -> None: """Sets the element extended settings. @@ -162,29 +146,26 @@ def set_extended_settings(element_id_list: list[ElementId], extended_settings: e extended_settings: The extended settings. """ - def set_wall(element_id_list: list[ElementId]) -> None: """Sets the element to wall. - Deprecated : + Deprecated : Use [set_framed_wall][attribute_controller.set_framed_wall] instead. Parameters: element_id_list: The element id list. """ - def set_floor(element_id_list: list[ElementId]) -> None: """Set floor. - Deprecated : + Deprecated : Use [set_framed_floor][attribute_controller.set_framed_floor] instead. - + Parameters: element_id_list: The element id list. """ - def set_opening(element_id_list: list[ElementId]) -> None: """Sets the element to opening. @@ -192,7 +173,6 @@ def set_opening(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_fastening_attribute(element_id_list: list[ElementId], value: str) -> None: """Sets the element fastening attribute. @@ -201,7 +181,6 @@ def set_fastening_attribute(element_id_list: list[ElementId], value: str) -> Non value: The fastening attribute value. """ - def set_element_material(element_id_list: list[ElementId], material: MaterialId) -> None: """Sets the element material. @@ -210,7 +189,6 @@ def set_element_material(element_id_list: list[ElementId], material: MaterialId) material: The element material id. """ - def set_assembly_number(element_id_list: list[ElementId], assembly_number: str) -> None: """set assembly number. @@ -219,7 +197,6 @@ def set_assembly_number(element_id_list: list[ElementId], assembly_number: str) assembly_number: The assembly number. """ - def set_list_quantity(element_id_list: list[ElementId], list_quantity: UnsignedInt) -> None: """Set list quantity. @@ -228,7 +205,6 @@ def set_list_quantity(element_id_list: list[ElementId], list_quantity: UnsignedI list_quantity: The list quantity. """ - def set_layer_settings(element_id_list: list[ElementId], layer_settings: layer_settings) -> None: """Set layer settings. @@ -237,7 +213,6 @@ def set_layer_settings(element_id_list: list[ElementId], layer_settings: layer_s layer_settings: The layer settings. """ - def set_ignore_in_vba_calculation(element_id_list: list[ElementId], ignore: bool) -> None: """Sets if the element should be ignored in VBA Calculation. @@ -246,11 +221,8 @@ def set_ignore_in_vba_calculation(element_id_list: list[ElementId], ignore: bool ignore: True if the element should be ignored in VBA calculation, false otherwise. """ - def clear_errors() -> None: - """clear all errors. - """ - + """clear all errors.""" def set_reference_wall_2dc(element_id_list: list[ElementId], _2dc_file_path: str) -> None: """Applies a new 2dc reference wall to an element. @@ -260,15 +232,13 @@ def set_reference_wall_2dc(element_id_list: list[ElementId], _2dc_file_path: str _2dc_file_path: The 2dc file path. """ - def get_user_attribute_count() -> UnsignedInt: """Get user attribute count. - + Returns: The count of user attributes. """ - def set_standard_part(element_id_list: list[ElementId]) -> None: """Sets covers (wall,opening or floor) to standard part. @@ -276,7 +246,6 @@ def set_standard_part(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_solid_wall(element_id_list: list[ElementId]) -> None: """Sets elements to solid wall. @@ -284,7 +253,6 @@ def set_solid_wall(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_log_wall(element_id_list: list[ElementId]) -> None: """Sets elements to log wall. @@ -292,7 +260,6 @@ def set_log_wall(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_solid_floor(element_id_list: list[ElementId]) -> None: """Sets elements to solid floor. @@ -300,18 +267,16 @@ def set_solid_floor(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_roof(element_id_list: list[ElementId]) -> None: """Set roof. - Deprecated : + Deprecated : Use [set_framed_roof][attribute_controller.set_framed_roof] instead. Parameters: element_id_list: The element id list. """ - def set_solid_roof(element_id_list: list[ElementId]) -> None: """Sets elements to solid roof cover. @@ -319,7 +284,6 @@ def set_solid_roof(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def get_node_symbol(element_id: ElementId) -> node_symbol: """Get node symbol. @@ -330,7 +294,6 @@ def get_node_symbol(element_id: ElementId) -> node_symbol: The node symbol of the element. """ - def set_node_symbol(element_id_list: list[ElementId], symbol: node_symbol) -> None: """Set node symbol. @@ -339,16 +302,11 @@ def set_node_symbol(element_id_list: list[ElementId], symbol: node_symbol) -> No symbol: The node symbol. """ - def enable_attribute_display() -> None: - """Enable attribute display. - """ - + """Enable attribute display.""" def disable_attribute_display() -> None: - """Disable attribute display. - """ - + """Disable attribute display.""" def is_attribute_display_enabled() -> bool: """Is attribute display enabled. @@ -357,11 +315,8 @@ def is_attribute_display_enabled() -> bool: True if attribute display is enabled, false otherwise. """ - def update_auto_attribute() -> None: - """Update the auto attribute. - """ - + """Update the auto attribute.""" def set_additional_guid(element_id_list: list[ElementId], data_id: str, guid: str) -> None: """Set additional guid. @@ -372,7 +327,6 @@ def set_additional_guid(element_id_list: list[ElementId], data_id: str, guid: st guid: The guid to set. """ - def add_item_to_group_list(item: str) -> None: """Add item to group list. @@ -380,7 +334,6 @@ def add_item_to_group_list(item: str) -> None: item: The item to add in the group list. """ - def add_item_to_subgroup_list(item: str) -> None: """Add item to subgroup list. @@ -388,7 +341,6 @@ def add_item_to_subgroup_list(item: str) -> None: item: The item to add in the subgroup list. """ - def add_item_to_comment_list(item: str) -> None: """Add item to comment list. @@ -396,7 +348,6 @@ def add_item_to_comment_list(item: str) -> None: item: The item to add in the comment list. """ - def add_item_to_sku_list(item: str) -> None: """Add item to sku list. @@ -404,7 +355,6 @@ def add_item_to_sku_list(item: str) -> None: item: The item to add in the sku list. """ - def add_item_to_user_attribute_list(attribute_number: UserAttributeId, item: str) -> None: """Add item to user attribute list. @@ -413,7 +363,6 @@ def add_item_to_user_attribute_list(attribute_number: UserAttributeId, item: str item: The item to add in the user attribute list. """ - def set_container_number(element_id_list: list[ElementId], number: UnsignedInt) -> None: """Set container number. @@ -422,7 +371,6 @@ def set_container_number(element_id_list: list[ElementId], number: UnsignedInt) number: The container number. """ - def get_name_list_items() -> list[str]: """Retrieve a list of name for all items @@ -430,7 +378,6 @@ def get_name_list_items() -> list[str]: A list of names for all items. """ - def add_item_to_name_list(item: str) -> None: """Add item to name list. @@ -438,7 +385,6 @@ def add_item_to_name_list(item: str) -> None: item: The item to add in the name list. """ - def delete_item_from_comment_list(item: str) -> bool: """Delete item from comment list. @@ -449,7 +395,6 @@ def delete_item_from_comment_list(item: str) -> bool: True if the item was successfully deleted, false otherwise. """ - def delete_item_from_group_list(item: str) -> bool: """Delete item from group list. @@ -460,7 +405,6 @@ def delete_item_from_group_list(item: str) -> bool: True if the item was successfully deleted, false otherwise. """ - def delete_item_from_sku_list(item: str) -> bool: """Delete item from sku list. @@ -471,7 +415,6 @@ def delete_item_from_sku_list(item: str) -> bool: True if the item was successfully deleted, false otherwise. """ - def delete_item_from_subgroup_list(item: str) -> bool: """Delete item from subgroup list. @@ -482,7 +425,6 @@ def delete_item_from_subgroup_list(item: str) -> bool: True if the item was successfully deleted, false otherwise. """ - def delete_item_from_user_attribute_list(attribute_number: UserAttributeId, item: str) -> bool: """Delete item from user attribute list. @@ -494,7 +436,6 @@ def delete_item_from_user_attribute_list(attribute_number: UserAttributeId, item True if the item was successfully deleted, false otherwise. """ - def set_attribute_display_settings_for_2d(settings: attribute_display_settings) -> None: """Set attribute display settings for 2d. @@ -502,7 +443,6 @@ def set_attribute_display_settings_for_2d(settings: attribute_display_settings) settings: The display settings to apply. """ - def set_attribute_display_settings_for_2d_with_layout(settings: attribute_display_settings) -> None: """Set attribute display settings for 2d with layout. @@ -510,7 +450,6 @@ def set_attribute_display_settings_for_2d_with_layout(settings: attribute_displa settings: The display settings to apply. """ - def set_attribute_display_settings_for_2d_without_layout(settings: attribute_display_settings) -> None: """Set attribute display settings for 2d without layout. @@ -518,7 +457,6 @@ def set_attribute_display_settings_for_2d_without_layout(settings: attribute_dis settings: The display settings to apply. """ - def set_attribute_display_settings_for_3d(settings: attribute_display_settings) -> None: """Set attribute display settings for 3d. @@ -526,7 +464,6 @@ def set_attribute_display_settings_for_3d(settings: attribute_display_settings) settings: The display settings to apply. """ - def set_attribute_display_settings_for_3d(settings: attribute_display_settings) -> None: """Set attribute display settings for 3d. @@ -534,7 +471,6 @@ def set_attribute_display_settings_for_3d(settings: attribute_display_settings) settings: The display settings to apply. """ - def set_attribute_display_settings_for_container(settings: attribute_display_settings) -> None: """Set attribute display settings for container. @@ -542,7 +478,6 @@ def set_attribute_display_settings_for_container(settings: attribute_display_set settings: The display settings to apply. """ - def set_attribute_display_settings_for_export_solid(settings: attribute_display_settings) -> None: """Set attribute display settings for export solid. @@ -550,7 +485,6 @@ def set_attribute_display_settings_for_export_solid(settings: attribute_display_ settings: The display settings to apply. """ - def set_attribute_display_settings_for_framed_wall_axis(settings: attribute_display_settings) -> None: """Set attribute display settings for framed wall axis. @@ -558,7 +492,6 @@ def set_attribute_display_settings_for_framed_wall_axis(settings: attribute_disp settings: The display settings to apply. """ - def set_attribute_display_settings_for_framed_wall_beam(settings: attribute_display_settings) -> None: """Set attribute display settings for framed wall beam. @@ -566,7 +499,6 @@ def set_attribute_display_settings_for_framed_wall_beam(settings: attribute_disp settings: The display settings to apply. """ - def set_attribute_display_settings_for_framed_wall_beam(settings: attribute_display_settings) -> None: """Set attribute display settings for framed wall beam. @@ -574,7 +506,6 @@ def set_attribute_display_settings_for_framed_wall_beam(settings: attribute_disp settings: The display settings to apply. """ - def set_attribute_display_settings_for_framed_wall_opening(settings: attribute_display_settings) -> None: """Set attribute display settings for framed wall opening. @@ -582,7 +513,6 @@ def set_attribute_display_settings_for_framed_wall_opening(settings: attribute_d settings: The display settings to apply. """ - def set_attribute_display_settings_for_framed_wall_panel(settings: attribute_display_settings) -> None: """Set attribute display settings for framed wall panel. @@ -590,7 +520,6 @@ def set_attribute_display_settings_for_framed_wall_panel(settings: attribute_dis settings: The display settings to apply. """ - def set_attribute_display_settings_for_log_wall_axis(settings: attribute_display_settings) -> None: """Set attribute display settings for log wall axis. @@ -598,7 +527,6 @@ def set_attribute_display_settings_for_log_wall_axis(settings: attribute_display settings: The display settings to apply. """ - def set_attribute_display_settings_for_log_wall_beam(settings: attribute_display_settings) -> None: """Set attribute display settings for log wall beam. @@ -606,7 +534,6 @@ def set_attribute_display_settings_for_log_wall_beam(settings: attribute_display settings: The display settings to apply. """ - def set_attribute_display_settings_for_log_wall_opening(settings: attribute_display_settings) -> None: """Set attribute display settings for log wall opening. @@ -614,7 +541,6 @@ def set_attribute_display_settings_for_log_wall_opening(settings: attribute_disp settings: The display settings to apply. """ - def set_attribute_display_settings_for_log_wall_panel(settings: attribute_display_settings) -> None: """Set attribute display settings for log wall panel. @@ -622,7 +548,6 @@ def set_attribute_display_settings_for_log_wall_panel(settings: attribute_displa settings: The display settings to apply. """ - def set_attribute_display_settings_for_machine(settings: attribute_display_settings) -> None: """Set attribute display settings for machine. @@ -630,7 +555,6 @@ def set_attribute_display_settings_for_machine(settings: attribute_display_setti settings: The display settings to apply. """ - def set_attribute_display_settings_for_nesting_element(settings: attribute_display_settings) -> None: """Set attribute display settings for nesting element. @@ -638,7 +562,6 @@ def set_attribute_display_settings_for_nesting_element(settings: attribute_displ settings: The display settings to apply. """ - def set_attribute_display_settings_for_nesting_volume(settings: attribute_display_settings) -> None: """Set attribute display settings for nesting volume. @@ -646,7 +569,6 @@ def set_attribute_display_settings_for_nesting_volume(settings: attribute_displa settings: The display settings to apply. """ - def set_attribute_display_settings_for_solid_wall_axis(settings: attribute_display_settings) -> None: """Set attribute display settings for solid wall axis. @@ -654,7 +576,6 @@ def set_attribute_display_settings_for_solid_wall_axis(settings: attribute_displ settings: The display settings to apply. """ - def set_attribute_display_settings_for_solid_wall_beam(settings: attribute_display_settings) -> None: """Set attribute display settings for solid wall beam. @@ -662,7 +583,6 @@ def set_attribute_display_settings_for_solid_wall_beam(settings: attribute_displ settings: The display settings to apply. """ - def set_attribute_display_settings_for_solid_wall_opening(settings: attribute_display_settings) -> None: """Set attribute display settings for solid wall opening. @@ -670,7 +590,6 @@ def set_attribute_display_settings_for_solid_wall_opening(settings: attribute_di settings: The display settings to apply. """ - def set_attribute_display_settings_for_solid_wall_panel(settings: attribute_display_settings) -> None: """Set attribute display settings for solid wall panel. @@ -678,7 +597,6 @@ def set_attribute_display_settings_for_solid_wall_panel(settings: attribute_disp settings: The display settings to apply. """ - def set_framed_floor(element_id_list: list[ElementId]) -> None: """Sets the elements to framed floor. @@ -686,7 +604,6 @@ def set_framed_floor(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_framed_roof(element_id_list: list[ElementId]) -> None: """Sets the elements to framed roof. @@ -694,7 +611,6 @@ def set_framed_roof(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def set_framed_wall(element_id_list: list[ElementId]) -> None: """Sets the element to framed wall. @@ -702,7 +618,6 @@ def set_framed_wall(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ - def get_name_list_items_by_element_type(element_type: element_type) -> list[str]: """Get name list items by element type. @@ -713,7 +628,6 @@ def get_name_list_items_by_element_type(element_type: element_type) -> list[str] The list of names for the specified element type. """ - def get_name(element_id: ElementId) -> str: """Gets the element name. @@ -724,7 +638,6 @@ def get_name(element_id: ElementId) -> str: The element name. """ - def get_group(element_id: ElementId) -> str: """Gets the element group. @@ -735,7 +648,6 @@ def get_group(element_id: ElementId) -> str: The element group. """ - def get_subgroup(element_id: ElementId) -> str: """Gets the element subgroup. @@ -746,7 +658,6 @@ def get_subgroup(element_id: ElementId) -> str: The element subgroup. """ - def get_comment(element_id: ElementId) -> str: """Gets the element comment. @@ -757,7 +668,6 @@ def get_comment(element_id: ElementId) -> str: The element comment. """ - def get_user_attribute(element_id: ElementId, number: UserAttributeId) -> str: """Gets the element user attribute. @@ -769,7 +679,6 @@ def get_user_attribute(element_id: ElementId, number: UserAttributeId) -> str: The element user attribute. """ - def get_sku(element_id: ElementId) -> str: """Gets the element SKU. @@ -780,7 +689,6 @@ def get_sku(element_id: ElementId) -> str: The element SKU. """ - def get_production_number(element_id: ElementId) -> UnsignedInt: """Gets the element production number. @@ -791,7 +699,6 @@ def get_production_number(element_id: ElementId) -> UnsignedInt: The element production number. """ - def get_part_number(element_id: ElementId) -> UnsignedInt: """Gets the element part number. @@ -802,7 +709,6 @@ def get_part_number(element_id: ElementId) -> UnsignedInt: The element part number. """ - def get_additional_data(element_id: ElementId, data_id: str) -> str: """Gets the element additional data. @@ -814,7 +720,6 @@ def get_additional_data(element_id: ElementId, data_id: str) -> str: The element additional data. """ - def get_user_attribute_name(number: UserAttributeId) -> str: """Gets the user attribute name. @@ -825,7 +730,6 @@ def get_user_attribute_name(number: UserAttributeId) -> str: The user attribute name. """ - def get_wall_situation(element_id: ElementId) -> str: """Gets the element wall situation. @@ -836,7 +740,6 @@ def get_wall_situation(element_id: ElementId) -> str: The element wall situation. """ - def get_element_material_name(element_id: ElementId) -> str: """Gets the element material name. @@ -847,7 +750,6 @@ def get_element_material_name(element_id: ElementId) -> str: The element material name. """ - def get_prefab_layer(element_id: ElementId) -> str: """Gets the element prefab layer. @@ -858,7 +760,6 @@ def get_prefab_layer(element_id: ElementId) -> str: The element prefab layer. """ - def get_machine_calculation_set(element_id: ElementId) -> str: """Gets the element machine calculation set. @@ -869,7 +770,6 @@ def get_machine_calculation_set(element_id: ElementId) -> str: The element machine calculation set. """ - def get_cutting_set(element_id: ElementId) -> str: """Gets the element cutting set. @@ -880,7 +780,6 @@ def get_cutting_set(element_id: ElementId) -> str: The element cutting set. """ - def get_name_process_type(name: str) -> process_type: """Gets the process type for an element name. @@ -891,7 +790,6 @@ def get_name_process_type(name: str) -> process_type: The process type. """ - def get_name_extended_settings(name: str) -> extended_settings: """Gets the extended settings for an element name. @@ -902,7 +800,6 @@ def get_name_extended_settings(name: str) -> extended_settings: The extended settings. """ - def get_output_type(element_id: ElementId) -> process_type: """Gets the element output type. @@ -913,7 +810,6 @@ def get_output_type(element_id: ElementId) -> process_type: The element output type. """ - def get_extended_settings(element_id: ElementId) -> extended_settings: """Gets the element extended settings. @@ -924,7 +820,6 @@ def get_extended_settings(element_id: ElementId) -> extended_settings: The element extended settings. """ - def get_element_type(element_id: ElementId) -> element_type: """Gets the element type. @@ -935,7 +830,6 @@ def get_element_type(element_id: ElementId) -> element_type: The element type. """ - def get_fastening_attribute(element_id: ElementId) -> str: """Get the element fastening attribute. @@ -946,7 +840,6 @@ def get_fastening_attribute(element_id: ElementId) -> str: The element fastening attribute. """ - def get_assembly_number(element_id: ElementId) -> str: """Get assembly number. @@ -957,7 +850,6 @@ def get_assembly_number(element_id: ElementId) -> str: The assembly number. """ - def get_list_quantity(element_id: ElementId) -> UnsignedInt: """Get list quantity. @@ -968,7 +860,6 @@ def get_list_quantity(element_id: ElementId) -> UnsignedInt: The list quantity. """ - def get_ignore_in_vba_calculation(element_id: ElementId) -> bool: """Get ignore in vba calculation. @@ -979,7 +870,6 @@ def get_ignore_in_vba_calculation(element_id: ElementId) -> bool: True if the element is ignored in VBA calculation, false otherwise. """ - def get_standard_element_name(element_id: ElementId) -> str: """Get standard element name. @@ -990,7 +880,6 @@ def get_standard_element_name(element_id: ElementId) -> str: The standard element name. """ - def get_steel_shape_name(element_id: ElementId) -> str: """Get steel shape name. @@ -1001,7 +890,6 @@ def get_steel_shape_name(element_id: ElementId) -> str: The steel shape name. """ - def is_beam(element_id: ElementId) -> bool: """Tests if element is beam. @@ -1012,7 +900,6 @@ def is_beam(element_id: ElementId) -> bool: True if the element is a beam, false otherwise. """ - def is_panel(element_id: ElementId) -> bool: """Tests if element is panel. @@ -1023,7 +910,6 @@ def is_panel(element_id: ElementId) -> bool: True if the element is a panel, false otherwise. """ - def is_opening(element_id: ElementId) -> bool: """Tests if element is opening. @@ -1034,7 +920,6 @@ def is_opening(element_id: ElementId) -> bool: True if the element is an opening, false otherwise. """ - def is_wall(element_id: ElementId) -> bool: """Tests if element is wall. @@ -1045,7 +930,6 @@ def is_wall(element_id: ElementId) -> bool: True if the element is a wall, false otherwise. """ - def is_floor(element_id: ElementId) -> bool: """Tests if element is floor. @@ -1056,7 +940,6 @@ def is_floor(element_id: ElementId) -> bool: True if the element is a floor, false otherwise. """ - def is_roof(element_id: ElementId) -> bool: """Tests if element is roof. @@ -1067,7 +950,6 @@ def is_roof(element_id: ElementId) -> bool: True if the element is a roof, false otherwise. """ - def is_metal(element_id: ElementId) -> bool: """Tests if element is metal. @@ -1078,7 +960,6 @@ def is_metal(element_id: ElementId) -> bool: True if the element is metal, false otherwise. """ - def is_export_solid(element_id: ElementId) -> bool: """Tests if element is export solid. @@ -1089,7 +970,6 @@ def is_export_solid(element_id: ElementId) -> bool: True if the element is an export solid, false otherwise. """ - def is_container(element_id: ElementId) -> bool: """Tests if element is container. @@ -1100,7 +980,6 @@ def is_container(element_id: ElementId) -> bool: True if the element is a container, false otherwise. """ - def is_connector_axis(element_id: ElementId) -> bool: """Tests if element is connector axis. @@ -1111,7 +990,6 @@ def is_connector_axis(element_id: ElementId) -> bool: True if the element is a connector axis, false otherwise. """ - def is_drilling(element_id: ElementId) -> bool: """Tests if element is drilling. @@ -1122,7 +1000,6 @@ def is_drilling(element_id: ElementId) -> bool: True if the element is drilling, false otherwise. """ - def is_node(element_id: ElementId) -> bool: """Tests if element is node. @@ -1133,7 +1010,6 @@ def is_node(element_id: ElementId) -> bool: True if the element is a node, false otherwise. """ - def is_auxiliary(element_id: ElementId) -> bool: """Tests if element is auxiliary. @@ -1144,7 +1020,6 @@ def is_auxiliary(element_id: ElementId) -> bool: True if the element is auxiliary, false otherwise. """ - def is_roof_surface(element_id: ElementId) -> bool: """Tests if the element is roof surface. @@ -1155,7 +1030,6 @@ def is_roof_surface(element_id: ElementId) -> bool: True if the element is a roof surface, false otherwise. """ - def is_caddy_object(element_id: ElementId) -> bool: """Tests if the element is caddy object. @@ -1166,7 +1040,6 @@ def is_caddy_object(element_id: ElementId) -> bool: True if the element is a caddy object, false otherwise. """ - def is_envelope(element_id: ElementId) -> bool: """Tests if the element is an envelope. @@ -1177,7 +1050,6 @@ def is_envelope(element_id: ElementId) -> bool: True if the element is an envelope, false otherwise. """ - def is_architecture_wall_2dc(element_id: ElementId) -> bool: """Tests if the element is a 2dc reference wall. @@ -1188,7 +1060,6 @@ def is_architecture_wall_2dc(element_id: ElementId) -> bool: True if the element is a 2dc reference wall, false otherwise. """ - def is_architecture_wall_xml(element_id: ElementId) -> bool: """Tests if the element is a xml reference wall. @@ -1199,7 +1070,6 @@ def is_architecture_wall_xml(element_id: ElementId) -> bool: True if the element is a xml reference wall, false otherwise. """ - def is_surface(element_id: ElementId) -> bool: """Tests if the element is a Surface. @@ -1210,7 +1080,6 @@ def is_surface(element_id: ElementId) -> bool: True if the element is a Surface, false otherwise. """ - def is_line(element_id: ElementId) -> bool: """Tests if the element is a Line. @@ -1221,7 +1090,6 @@ def is_line(element_id: ElementId) -> bool: True if the element is a Line, false otherwise. """ - def get_auto_attribute(element_id: ElementId, number: UnsignedInt) -> str: """Get auto attribute. @@ -1233,7 +1101,6 @@ def get_auto_attribute(element_id: ElementId, number: UnsignedInt) -> str: The auto attribute value. """ - def get_auto_attribute_name(number: UnsignedInt) -> str: """Get auto attribute name. @@ -1244,7 +1111,6 @@ def get_auto_attribute_name(number: UnsignedInt) -> str: The auto attribute name. """ - def is_framed_wall(element_id: ElementId) -> bool: """Tests if the element is a framed wall. @@ -1255,7 +1121,6 @@ def is_framed_wall(element_id: ElementId) -> bool: True if the element is a framed wall, false otherwise. """ - def is_solid_wall(element_id: ElementId) -> bool: """Tests if the element is a solid wall. @@ -1266,7 +1131,6 @@ def is_solid_wall(element_id: ElementId) -> bool: True if the element is a solid wall, false otherwise. """ - def is_log_wall(element_id: ElementId) -> bool: """Tests if the element is a log wall. @@ -1277,7 +1141,6 @@ def is_log_wall(element_id: ElementId) -> bool: True if the element is a log wall, false otherwise. """ - def is_framed_floor(element_id: ElementId) -> bool: """Tests if the element is a framed floor. @@ -1288,7 +1151,6 @@ def is_framed_floor(element_id: ElementId) -> bool: True if the element is a framed floor, false otherwise. """ - def is_solid_floor(element_id: ElementId) -> bool: """Tests if the element is a solid floor. @@ -1299,7 +1161,6 @@ def is_solid_floor(element_id: ElementId) -> bool: True if the element is a solid floor, false otherwise. """ - def is_framed_roof(element_id: ElementId) -> bool: """Tests if the element is a framed roof. @@ -1310,7 +1171,6 @@ def is_framed_roof(element_id: ElementId) -> bool: True if the element is a framed roof, false otherwise. """ - def is_solid_roof(element_id: ElementId) -> bool: """Tests if the element is a solid roof. @@ -1321,7 +1181,6 @@ def is_solid_roof(element_id: ElementId) -> bool: True if the element is a solid roof, false otherwise. """ - def get_additional_guid(element_id: ElementId, data_id: str) -> str: """Get additional guid. @@ -1333,7 +1192,6 @@ def get_additional_guid(element_id: ElementId, data_id: str) -> str: The additional guid associated with the element and data id. """ - def get_prefab_layer_all_assigned(element_id: ElementId) -> list[int]: """Get all assigned prefab layers. @@ -1344,7 +1202,6 @@ def get_prefab_layer_all_assigned(element_id: ElementId) -> list[int]: The list of all assigned prefab layers for the element. """ - def get_prefab_layer_with_dimensions(element_id: ElementId) -> list[int]: """Get prefab layer with dimensions. @@ -1355,7 +1212,6 @@ def get_prefab_layer_with_dimensions(element_id: ElementId) -> list[int]: The list of prefab layers with dimensions for the element. """ - def get_prefab_layer_without_dimensions(element_id: ElementId) -> list[int]: """Get prefab layer without dimensions. @@ -1366,7 +1222,6 @@ def get_prefab_layer_without_dimensions(element_id: ElementId) -> list[int]: The list of prefab layers without dimensions for the element. """ - def is_nesting_parent(element_id: ElementId) -> bool: """Tests if the element is a nesting parent. @@ -1377,7 +1232,6 @@ def is_nesting_parent(element_id: ElementId) -> bool: True if the element is a nesting parent, false otherwise. """ - def is_nesting_raw_part(element_id: ElementId) -> bool: """Tests if the element is a nesting raw part. @@ -1388,7 +1242,6 @@ def is_nesting_raw_part(element_id: ElementId) -> bool: True if the element is a nesting raw part, false otherwise. """ - def get_container_number(element_id: ElementId) -> UnsignedInt: """Get container number. @@ -1399,7 +1252,6 @@ def get_container_number(element_id: ElementId) -> UnsignedInt: The container number associated with the element. """ - def get_container_number_with_prefix(element_id: ElementId) -> str: """Get container number with prefix. @@ -1410,7 +1262,6 @@ def get_container_number_with_prefix(element_id: ElementId) -> str: The container number with prefix associated with the element. """ - def get_group_list_items() -> list[str]: """Get group list items. @@ -1418,7 +1269,6 @@ def get_group_list_items() -> list[str]: The list of group list items. """ - def get_subgroup_list_items() -> list[str]: """Get subgroup list items. @@ -1426,7 +1276,6 @@ def get_subgroup_list_items() -> list[str]: The list of subgroup list items. """ - def get_comment_list_items() -> list[str]: """Get comment list items. @@ -1434,7 +1283,6 @@ def get_comment_list_items() -> list[str]: The list of comment list items. """ - def get_sku_list_items() -> list[str]: """Get sku list items. @@ -1442,7 +1290,6 @@ def get_sku_list_items() -> list[str]: The list of sku list items. """ - def get_user_attribute_list_items(number: UserAttributeId) -> list[str]: """Get user attribute list items. @@ -1453,7 +1300,6 @@ def get_user_attribute_list_items(number: UserAttributeId) -> list[str]: The list of user attribute list items. """ - def is_circular_mep(element_id: ElementId) -> bool: """Test if element is circular mep. @@ -1464,7 +1310,6 @@ def is_circular_mep(element_id: ElementId) -> bool: True if the element is a circular mep, false otherwise. """ - def is_rectangular_mep(element_id: ElementId) -> bool: """Test if element is rectangular mep. @@ -1475,7 +1320,6 @@ def is_rectangular_mep(element_id: ElementId) -> bool: True if the element is a rectangular mep, false otherwise. """ - def get_machine_calculation_state(element_id: ElementId) -> str: """Get machine calculation state. @@ -1486,7 +1330,6 @@ def get_machine_calculation_state(element_id: ElementId) -> str: The machine calculation state of the element. """ - def get_machine_calculation_set_machine_type(element_id: ElementId) -> str: """Get machine calculation set machine type. @@ -1497,7 +1340,6 @@ def get_machine_calculation_set_machine_type(element_id: ElementId) -> str: The machine calculation set machine type of the element. """ - def is_btl_processing_group(element_id: ElementId) -> bool: """Test if element is btl processing group. @@ -1508,7 +1350,6 @@ def is_btl_processing_group(element_id: ElementId) -> bool: True if the element is a btl processing group, false otherwise. """ - def is_hundegger_processing_group(element_id: ElementId) -> bool: """Test if element is hundegger processing group. @@ -1519,7 +1360,6 @@ def is_hundegger_processing_group(element_id: ElementId) -> bool: True if the element is a hundegger processing group, false otherwise. """ - def get_element_grouping_type() -> element_grouping_type: """Get the element grouping type (group, subgroup). @@ -1527,7 +1367,6 @@ def get_element_grouping_type() -> element_grouping_type: The element grouping type. """ - def set_element_grouping_type(element_grouping_type: element_grouping_type) -> None: """Set the element grouping type (group, subgroup). @@ -1535,7 +1374,6 @@ def set_element_grouping_type(element_grouping_type: element_grouping_type) -> N element_grouping_type: The element grouping type to set. """ - def get_associated_nesting_name(element_id: ElementId) -> str: """Get associated nesting name @@ -1546,7 +1384,6 @@ def get_associated_nesting_name(element_id: ElementId) -> str: The associated nesting name. """ - def get_associated_nesting_number(element_id: ElementId) -> str: """Get associated nesting number. @@ -1557,7 +1394,6 @@ def get_associated_nesting_number(element_id: ElementId) -> str: The associated nesting number. """ - def get_attribute_display_settings_for_2d() -> attribute_display_settings: """Get attribute display settings for 2d. @@ -1565,7 +1401,6 @@ def get_attribute_display_settings_for_2d() -> attribute_display_settings: The attribute display settings for 2d. """ - def get_attribute_display_settings_for_2d_with_layout() -> attribute_display_settings: """Get attribute display settings for 2d with layout. @@ -1573,7 +1408,6 @@ def get_attribute_display_settings_for_2d_with_layout() -> attribute_display_set The attribute display settings for 2d with layout. """ - def get_attribute_display_settings_for_2d_without_layout() -> attribute_display_settings: """Get attribute display settings for 2d without layout. @@ -1581,7 +1415,6 @@ def get_attribute_display_settings_for_2d_without_layout() -> attribute_display_ The attribute display settings for 2d without layout. """ - def get_attribute_display_settings_for_3d() -> attribute_display_settings: """Get attribute display settings for 3d. @@ -1589,7 +1422,6 @@ def get_attribute_display_settings_for_3d() -> attribute_display_settings: The attribute display settings for 3d. """ - def get_attribute_display_settings_for_container() -> attribute_display_settings: """Get attribute display settings for container. @@ -1597,7 +1429,6 @@ def get_attribute_display_settings_for_container() -> attribute_display_settings The attribute display settings for container. """ - def get_attribute_display_settings_for_export_solid() -> attribute_display_settings: """Get attribute display settings for export solid. @@ -1605,7 +1436,6 @@ def get_attribute_display_settings_for_export_solid() -> attribute_display_setti The attribute display settings for export solid. """ - def get_attribute_display_settings_for_framed_wall_axis() -> attribute_display_settings: """Get attribute display settings for framed wall axis. @@ -1613,7 +1443,6 @@ def get_attribute_display_settings_for_framed_wall_axis() -> attribute_display_s The attribute display settings for framed wall axis. """ - def get_attribute_display_settings_for_framed_wall_beam() -> attribute_display_settings: """Get attribute display settings for framed wall beam. @@ -1621,7 +1450,6 @@ def get_attribute_display_settings_for_framed_wall_beam() -> attribute_display_s The attribute display settings for framed wall beam. """ - def get_attribute_display_settings_for_framed_wall_opening() -> attribute_display_settings: """Get attribute display settings for framed wall opening. @@ -1629,7 +1457,6 @@ def get_attribute_display_settings_for_framed_wall_opening() -> attribute_displa The attribute display settings for framed wall opening. """ - def get_attribute_display_settings_for_framed_wall_panel() -> attribute_display_settings: """Get attribute display settings for framed wall panel. @@ -1637,7 +1464,6 @@ def get_attribute_display_settings_for_framed_wall_panel() -> attribute_display_ The attribute display settings for framed wall panel. """ - def get_attribute_display_settings_for_log_wall_axis() -> attribute_display_settings: """Get attribute display settings for log wall axis. @@ -1645,7 +1471,6 @@ def get_attribute_display_settings_for_log_wall_axis() -> attribute_display_sett The attribute display settings for log wall axis. """ - def get_attribute_display_settings_for_log_wall_beam() -> attribute_display_settings: """Get attribute display settings for log wall beam. @@ -1653,7 +1478,6 @@ def get_attribute_display_settings_for_log_wall_beam() -> attribute_display_sett The attribute display settings for log wall beam. """ - def get_attribute_display_settings_for_log_wall_opening() -> attribute_display_settings: """Get attribute display settings for log wall opening. @@ -1661,7 +1485,6 @@ def get_attribute_display_settings_for_log_wall_opening() -> attribute_display_s The attribute display settings for log wall opening. """ - def get_attribute_display_settings_for_log_wall_panel() -> attribute_display_settings: """Get attribute display settings for log wall panel. @@ -1669,7 +1492,6 @@ def get_attribute_display_settings_for_log_wall_panel() -> attribute_display_set The attribute display settings for log wall panel. """ - def get_attribute_display_settings_for_machine() -> attribute_display_settings: """Get attribute display settings for machine. @@ -1677,7 +1499,6 @@ def get_attribute_display_settings_for_machine() -> attribute_display_settings: The attribute display settings for machine. """ - def get_attribute_display_settings_for_nesting_element() -> attribute_display_settings: """Get attribute display settings for nesting element. @@ -1685,7 +1506,6 @@ def get_attribute_display_settings_for_nesting_element() -> attribute_display_se The attribute display settings for nesting element. """ - def get_attribute_display_settings_for_nesting_volume() -> attribute_display_settings: """Get attribute display settings for nesting volume. @@ -1693,7 +1513,6 @@ def get_attribute_display_settings_for_nesting_volume() -> attribute_display_set The attribute display settings for nesting volume. """ - def get_attribute_display_settings_for_solid_wall_axis() -> attribute_display_settings: """Get attribute display settings for solid wall axis. @@ -1701,7 +1520,6 @@ def get_attribute_display_settings_for_solid_wall_axis() -> attribute_display_se The attribute display settings for solid wall axis. """ - def get_attribute_display_settings_for_solid_wall_beam() -> attribute_display_settings: """Get attribute display settings for solid wall beam. @@ -1709,7 +1527,6 @@ def get_attribute_display_settings_for_solid_wall_beam() -> attribute_display_se The attribute display settings for solid wall beam. """ - def get_attribute_display_settings_for_solid_wall_opening() -> attribute_display_settings: """Get attribute display settings for solid wall opening. @@ -1717,7 +1534,6 @@ def get_attribute_display_settings_for_solid_wall_opening() -> attribute_display The attribute display settings for solid wall opening. """ - def get_attribute_display_settings_for_solid_wall_panel() -> attribute_display_settings: """Get attribute display settings for solid wall panel. @@ -1725,7 +1541,6 @@ def get_attribute_display_settings_for_solid_wall_panel() -> attribute_display_s The attribute display settings for solid wall panel. """ - def is_processing(element_id: ElementId) -> bool: """Tests if element is processing. @@ -1736,7 +1551,6 @@ def is_processing(element_id: ElementId) -> bool: True if the element is processing, false otherwise. """ - def delete_user_attribute(number: UserAttributeId) -> bool: """Delete user attribute from attribute list. The attribute is only deleted when the attribute is not used. @@ -1747,7 +1561,6 @@ def delete_user_attribute(number: UserAttributeId) -> bool: True if the attribute was successfully deleted, false otherwise. """ - def is_attribute_visible_in_modify_window(number: UnsignedInt) -> bool: """Test if attribute is visible in modify window. @@ -1758,7 +1571,6 @@ def is_attribute_visible_in_modify_window(number: UnsignedInt) -> bool: True if the attribute is visible in the modify window, false otherwise. """ - def set_attribute_visibility_in_modify_window(number: UnsignedInt, visibility: bool) -> None: """Set attribute visibility in modify window. @@ -1767,7 +1579,6 @@ def set_attribute_visibility_in_modify_window(number: UnsignedInt, visibility: b visibility: The visibility state. """ - def set_cutting_set(element_id_list: list[ElementId], cutting_set_name: str) -> bool: """Set cutting set. @@ -1779,7 +1590,6 @@ def set_cutting_set(element_id_list: list[ElementId], cutting_set_name: str) -> True if the cutting set was successfully set, false otherwise. """ - def get_standard_element_material_id(element_id: ElementId) -> int: """Get standard element material id. @@ -1790,7 +1600,6 @@ def get_standard_element_material_id(element_id: ElementId) -> int: The standard element material id. """ - def set_machine_calculation_set(element_ids: list[ElementId], name: str) -> bool: """Set machine calculation set for a list of elements. diff --git a/src/bim_controller/__init__.pyi b/src/bim_controller/__init__.pyi index 8f1c556..5d06b7d 100644 --- a/src/bim_controller/__init__.pyi +++ b/src/bim_controller/__init__.pyi @@ -51,14 +51,13 @@ def get_ifc2x3_element_type(element_id: ElementId) -> ifc_2x3_element_type: The ifc_2x3_element_type of the element. """ - def set_ifc2x3_element_type(element_id_list: list[ElementId], ifc_type: ifc_2x3_element_type) -> None: """Set ifc2x3 element type. Parameters: element_id_list: The list of element ids. ifc_type: The ifc_2x3_element_type to set. - + Examples: >>> import element_controller as ec >>> import bim_controller as bc @@ -298,7 +297,6 @@ def get_storey_height(building: str, storey: str) -> float: The height of the storey. """ - def get_ifc2x3_element_type_string(entity_type: ifc_2x3_element_type) -> str: """Get IFC2x3 element type string. @@ -309,7 +307,6 @@ def get_ifc2x3_element_type_string(entity_type: ifc_2x3_element_type) -> str: The string representation of the IFC2x3 element type. """ - def get_ifc2x3_element_type_display_string(entity_type: ifc_2x3_element_type) -> str: """Get IFC2x3 element type display string. @@ -337,7 +334,6 @@ def get_all_storeys(building: str) -> list[str]: A list of all storeys in the building. """ - def get_element_id_from_base64_ifc_guid(base_64_ifc_guid: str) -> ElementId: """Get element id from base64 ifc guid. @@ -368,7 +364,6 @@ def get_ifc_predefined_type(element_id: ElementId) -> 'ifc_predefined_type': The IfcPredefinedType of the element. """ - def set_ifc_predefined_type(element_id_list: list[ElementId], predefined_type: ifc_predefined_type) -> None: """Set a predefined type to elements. Attention, if you change the PredefinedType of the elements, you are responsible for ensuring that valid types are set. diff --git a/src/cadwork/__init__.pyi b/src/cadwork/__init__.pyi index 696144f..dd8abdd 100644 --- a/src/cadwork/__init__.pyi +++ b/src/cadwork/__init__.pyi @@ -95,92 +95,91 @@ from .working_plane_exit_view import working_plane_exit_view as working_plane_ex __all__ = [ # Type aliases - "AxisId", - "ColorId", - "ElementId", - "EndtypeId", - "MaterialId", - "MenuIndex", - "MultiLayerSetId", - "ReferenceSide", - "UnsignedInt", - "UserAttributeId", + 'AxisId', + 'ColorId', + 'ElementId', + 'EndtypeId', + 'MaterialId', + 'MenuIndex', + 'MultiLayerSetId', + 'ReferenceSide', + 'UnsignedInt', + 'UserAttributeId', # Data classes - "active_point_result", - "attribute_display_settings", - "bim_team_upload_result", - "camera_data", - "connector_axis_item", - "coordinate_system_data", - "double_shoulder_options", - "edge_list", - "element_filter", - "element_map_query", - "element_module_detail", - "element_module_properties", - "extended_settings", - "facet_list", - "heel_shoulder_beam_geometry", - "heel_shoulder_options", - "hit_result", - "ifc_material_definition", - "ifc_options", - "ifc_options_aggregation", - "ifc_options_level_of_detail", - "ifc_options_project_data", - "ifc_options_properties", - "import_3dc_options", - "layer_settings", - "panel_prefab_element_data", - "panel_prefab_element_settings", - "point", - "point_2d", - "point_3d", - "polygon_list", - "rhino_options", - "rgb_color", - "shoulder_beam_geometry", - "shoulder_options", - "text_object_options", - "vertex_list", - "window_geometry", + 'active_point_result', + 'attribute_display_settings', + 'bim_team_upload_result', + 'camera_data', + 'connector_axis_item', + 'coordinate_system_data', + 'double_shoulder_options', + 'edge_list', + 'element_filter', + 'element_map_query', + 'element_module_detail', + 'element_module_properties', + 'extended_settings', + 'facet_list', + 'heel_shoulder_beam_geometry', + 'heel_shoulder_options', + 'hit_result', + 'ifc_material_definition', + 'ifc_options', + 'ifc_options_aggregation', + 'ifc_options_level_of_detail', + 'ifc_options_project_data', + 'ifc_options_properties', + 'import_3dc_options', + 'layer_settings', + 'panel_prefab_element_data', + 'panel_prefab_element_settings', + 'point', + 'point_2d', + 'point_3d', + 'polygon_list', + 'rhino_options', + 'rgb_color', + 'shoulder_beam_geometry', + 'shoulder_options', + 'text_object_options', + 'vertex_list', + 'window_geometry', # Enumerations - "bim_team_upload_result_code", - "btl_version", - "dimension_base_format", - "display_attribute", - "division_zone_direction", - "dxf_export_version", - "dxf_layer_format_type", - "element_grouping_type", - "element_type", - "end_type", - "hundegger_machine_type", - "ifc_2x3_element_type", - "ifc_element_combine_behaviour", - "ifc_predefined_type", - "language", - "multi_layer_cover_type", - "multi_layer_subtype", - "multi_layer_type", - "node_symbol", - "panel_prefab_element_type", - "process_type", - "projection_type", - "shortcut_key", - "shortcut_key_modifier", - "shoulder_drilling_orientation", - "standard_element_type", - "text_element_type", - "vba_catalog_item_type", - "weinmann_mfb_version", - "working_plane_exit_view", + 'bim_team_upload_result_code', + 'btl_version', + 'dimension_base_format', + 'display_attribute', + 'division_zone_direction', + 'dxf_export_version', + 'dxf_layer_format_type', + 'element_grouping_type', + 'element_type', + 'end_type', + 'hundegger_machine_type', + 'ifc_2x3_element_type', + 'ifc_element_combine_behaviour', + 'ifc_predefined_type', + 'language', + 'multi_layer_cover_type', + 'multi_layer_subtype', + 'multi_layer_type', + 'node_symbol', + 'panel_prefab_element_type', + 'process_type', + 'projection_type', + 'shortcut_key', + 'shortcut_key_modifier', + 'shoulder_drilling_orientation', + 'standard_element_type', + 'text_element_type', + 'vba_catalog_item_type', + 'weinmann_mfb_version', + 'working_plane_exit_view', # Module-level functions - "get_auto_attribute_elements", - "set_auto_attribute", + 'get_auto_attribute_elements', + 'set_auto_attribute', ] - def get_auto_attribute_elements() -> list[int]: """Get only the elements of the selected types in the attribute manager dialog. @@ -190,7 +189,6 @@ def get_auto_attribute_elements() -> list[int]: list[int]: element IDs """ - def set_auto_attribute(elements: list[int], value: str) -> None: """Set the auto attribute to the selected element types. diff --git a/src/cadwork/active_point_result.py b/src/cadwork/active_point_result.py index d4ec1f5..ebb2735 100644 --- a/src/cadwork/active_point_result.py +++ b/src/cadwork/active_point_result.py @@ -6,7 +6,7 @@ @dataclass(frozen=True) class active_point_result: has_point: bool - point: Optional["point_3d"] = None + point: Optional['point_3d'] = None def __bool__(self) -> bool: return self.has_point diff --git a/src/cadwork/api_types.pyi b/src/cadwork/api_types.pyi index 19531d6..c6d182d 100644 --- a/src/cadwork/api_types.pyi +++ b/src/cadwork/api_types.pyi @@ -12,14 +12,14 @@ UserAttributeId: TypeAlias = int ElementId: TypeAlias = int __all__ = [ - "UnsignedInt", - "MaterialId", - "ColorId", - "EndtypeId", - "AxisId", - "MenuIndex", - "ReferenceSide", - "MultiLayerSetId", - "UserAttributeId", - "ElementId", + 'UnsignedInt', + 'MaterialId', + 'ColorId', + 'EndtypeId', + 'AxisId', + 'MenuIndex', + 'ReferenceSide', + 'MultiLayerSetId', + 'UserAttributeId', + 'ElementId', ] diff --git a/src/cadwork/attribute_display_settings.pyi b/src/cadwork/attribute_display_settings.pyi index 0491826..299601d 100644 --- a/src/cadwork/attribute_display_settings.pyi +++ b/src/cadwork/attribute_display_settings.pyi @@ -1,6 +1,6 @@ class attribute_display_settings: """attribute display settings""" - + def get_text_position_percentage(self) -> int: """get text position percentage @@ -68,4 +68,3 @@ class attribute_display_settings: Returns: None """ - diff --git a/src/cadwork/bim_team_upload_result.pyi b/src/cadwork/bim_team_upload_result.pyi index 56f41ab..69ed80f 100644 --- a/src/cadwork/bim_team_upload_result.pyi +++ b/src/cadwork/bim_team_upload_result.pyi @@ -1,9 +1,7 @@ from src.cadwork.bim_team_upload_result_code import bim_team_upload_result_code - class bim_team_upload_result: - """bim team upload result - """ + """bim team upload result""" def __init__(self): """ @@ -14,4 +12,4 @@ class bim_team_upload_result: share_link (str): The share link for the uploaded BIM team result. """ self.upload_result_code = bim_team_upload_result_code.ok - self.share_link = "" + self.share_link = '' diff --git a/src/cadwork/bim_team_upload_result_code.pyi b/src/cadwork/bim_team_upload_result_code.pyi index 344d7f2..78e458d 100644 --- a/src/cadwork/bim_team_upload_result_code.pyi +++ b/src/cadwork/bim_team_upload_result_code.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class bim_team_upload_result_code(IntEnum): """bim team upload result code @@ -9,6 +8,7 @@ class bim_team_upload_result_code(IntEnum): >>> cadwork.bim_team_upload_result_code.ok ok """ + ok = 0 """""" error_general_error = 1 diff --git a/src/cadwork/btl_version.pyi b/src/cadwork/btl_version.pyi index 3905eb0..a0da76d 100644 --- a/src/cadwork/btl_version.pyi +++ b/src/cadwork/btl_version.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class btl_version(IntEnum): """btl version @@ -9,6 +8,7 @@ class btl_version(IntEnum): >>> cadwork.btl_version.btlx_1_0 btlx_1_0 """ + btlx_1_0 = 110 """""" btlx_1_1 = 111 @@ -46,4 +46,3 @@ class btl_version(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/camera_data.pyi b/src/cadwork/camera_data.pyi index 4d8a685..26158ee 100644 --- a/src/cadwork/camera_data.pyi +++ b/src/cadwork/camera_data.pyi @@ -2,7 +2,6 @@ from cadwork import point_3d from cadwork import projection_type class camera_data: - def get_position(self) -> point_3d: """get position @@ -121,4 +120,3 @@ class camera_data: Returns: None """ - diff --git a/src/cadwork/connector_axis_item.pyi b/src/cadwork/connector_axis_item.pyi index ea991c7..388684d 100644 --- a/src/cadwork/connector_axis_item.pyi +++ b/src/cadwork/connector_axis_item.pyi @@ -1,5 +1,4 @@ class connector_axis_item: - def get_guid(self) -> str: """get guid diff --git a/src/cadwork/coordinate_system_data.pyi b/src/cadwork/coordinate_system_data.pyi index 60e7736..477c82a 100644 --- a/src/cadwork/coordinate_system_data.pyi +++ b/src/cadwork/coordinate_system_data.pyi @@ -1,7 +1,6 @@ from cadwork import point_3d class coordinate_system_data: - def get_p1(self) -> point_3d: """get p1 @@ -22,4 +21,3 @@ class coordinate_system_data: Returns: point_3d """ - diff --git a/src/cadwork/dimension_base_format.pyi b/src/cadwork/dimension_base_format.pyi index af5d8d1..8cbc68a 100644 --- a/src/cadwork/dimension_base_format.pyi +++ b/src/cadwork/dimension_base_format.pyi @@ -1,14 +1,14 @@ from enum import IntEnum, unique - @unique class dimension_base_format(IntEnum): - """ Enumeration for dimension base format. + """Enumeration for dimension base format. Examples: >>> cadwork.dimension_base_format.sum_only """ + none = 0 """""" distance_only = 1 diff --git a/src/cadwork/division_zone_direction.pyi b/src/cadwork/division_zone_direction.pyi index 9be17cd..af306fb 100644 --- a/src/cadwork/division_zone_direction.pyi +++ b/src/cadwork/division_zone_direction.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class division_zone_direction(IntEnum): """division zone direction @@ -9,6 +8,7 @@ class division_zone_direction(IntEnum): >>> cadwork.division_zone_direction.positive positive """ + positive = 1 """""" negative = 2 @@ -18,4 +18,3 @@ class division_zone_direction(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/double_shoulder_options.pyi b/src/cadwork/double_shoulder_options.pyi index 95b96c3..f0b7f92 100644 --- a/src/cadwork/double_shoulder_options.pyi +++ b/src/cadwork/double_shoulder_options.pyi @@ -1,5 +1,4 @@ class double_shoulder_options: - def get_add_drilling_axis(self) -> bool: """get add drilling axis @@ -271,4 +270,3 @@ class double_shoulder_options: Returns: None """ - diff --git a/src/cadwork/dxf_export_version.pyi b/src/cadwork/dxf_export_version.pyi index 8bceba1..d792680 100644 --- a/src/cadwork/dxf_export_version.pyi +++ b/src/cadwork/dxf_export_version.pyi @@ -1,14 +1,14 @@ from enum import IntEnum, unique - @unique class dxf_export_version(IntEnum): - """ Enumeration for DXF export version. + """Enumeration for DXF export version. Examples: >>> cadwork.dxf_export_version.auto_cad_r27 """ + auto_cad_r10 = 0 """""" auto_cad_r27 = 1 diff --git a/src/cadwork/dxf_layer_format_type.pyi b/src/cadwork/dxf_layer_format_type.pyi index 74bf6eb..8a602b1 100644 --- a/src/cadwork/dxf_layer_format_type.pyi +++ b/src/cadwork/dxf_layer_format_type.pyi @@ -1,14 +1,14 @@ from enum import IntEnum, unique - @unique class dxf_layer_format_type(IntEnum): - """ Enumeration for DXF layer format type. + """Enumeration for DXF layer format type. Examples: >>> cadwork.dxf_layer_format_type.color """ + all_in_no_1 = 0 """""" color = 1 diff --git a/src/cadwork/edge_list.pyi b/src/cadwork/edge_list.pyi index d976865..d623631 100644 --- a/src/cadwork/edge_list.pyi +++ b/src/cadwork/edge_list.pyi @@ -3,7 +3,6 @@ from typing import Iterator from cadwork import point_3d class edge_list: - def count(self) -> int: """count @@ -22,8 +21,5 @@ class edge_list: """ def __len__(self) -> int: ... - def __iter__(self) -> Iterator[point_3d]: ... - def __getitem__(self, index: int) -> point_3d: ... - diff --git a/src/cadwork/element_filter.pyi b/src/cadwork/element_filter.pyi index d8af660..cc8ac6f 100644 --- a/src/cadwork/element_filter.pyi +++ b/src/cadwork/element_filter.pyi @@ -1,5 +1,4 @@ class element_filter: - def set_name(self, name: str) -> None: """set name diff --git a/src/cadwork/element_grouping_type.pyi b/src/cadwork/element_grouping_type.pyi index bb73db8..e027d79 100644 --- a/src/cadwork/element_grouping_type.pyi +++ b/src/cadwork/element_grouping_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class element_grouping_type(IntEnum): """element grouping type @@ -9,6 +8,7 @@ class element_grouping_type(IntEnum): >>> cadwork.element_grouping_type.group group """ + group = 1 """""" subgroup = 2 @@ -16,4 +16,3 @@ class element_grouping_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/element_map_query.pyi b/src/cadwork/element_map_query.pyi index c187566..f45d233 100644 --- a/src/cadwork/element_map_query.pyi +++ b/src/cadwork/element_map_query.pyi @@ -1,5 +1,4 @@ class element_map_query: - def set_by_name(self) -> None: """set by name diff --git a/src/cadwork/element_module_detail.pyi b/src/cadwork/element_module_detail.pyi index 387574d..269110a 100644 --- a/src/cadwork/element_module_detail.pyi +++ b/src/cadwork/element_module_detail.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class element_module_detail(IntEnum): """element module detail @@ -9,6 +8,7 @@ class element_module_detail(IntEnum): >>> cadwork.element_module_detail.no_detail no_detail """ + no_detail = 1 """""" angle_detail = 2 @@ -38,4 +38,3 @@ class element_module_detail(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/element_module_properties.pyi b/src/cadwork/element_module_properties.pyi index c6bed0a..f7cd681 100644 --- a/src/cadwork/element_module_properties.pyi +++ b/src/cadwork/element_module_properties.pyi @@ -1,5 +1,4 @@ class element_module_properties: - def is_stretch_with_top_of_wall(self) -> bool: """is stretch with top of wall @@ -672,4 +671,3 @@ class element_module_properties: Returns: None """ - diff --git a/src/cadwork/element_type.pyi b/src/cadwork/element_type.pyi index 8104e15..fe19e62 100644 --- a/src/cadwork/element_type.pyi +++ b/src/cadwork/element_type.pyi @@ -1,5 +1,4 @@ class element_type: - def is_none(self) -> bool: """is none @@ -440,4 +439,3 @@ class element_type: Returns: None """ - diff --git a/src/cadwork/end_type.pyi b/src/cadwork/end_type.pyi index 972ed2d..5928a39 100644 --- a/src/cadwork/end_type.pyi +++ b/src/cadwork/end_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class end_type(IntEnum): """end type diff --git a/src/cadwork/extended_settings.pyi b/src/cadwork/extended_settings.pyi index 80745a5..b70f522 100644 --- a/src/cadwork/extended_settings.pyi +++ b/src/cadwork/extended_settings.pyi @@ -1,5 +1,4 @@ class extended_settings: - def get_btl_wall_export(self) -> bool: """get btl wall export @@ -176,23 +175,23 @@ class extended_settings: Returns: None """ - - def get_ignore_processing(self) ->bool: + + def get_ignore_processing(self) -> bool: """get ignore processing - Returns: - bool - """ + Returns: + bool + """ - def set_ignore_processing(self, value: bool) ->None: + def set_ignore_processing(self, value: bool) -> None: """set ignore processing - Parameters: - value: value + Parameters: + value: value - Returns: - None - """ + Returns: + None + """ def get_single_piece(self) -> bool: """get single piece @@ -243,4 +242,4 @@ class extended_settings: Returns: None - """ \ No newline at end of file + """ diff --git a/src/cadwork/facet_list.pyi b/src/cadwork/facet_list.pyi index 71e5a6f..17ffea2 100644 --- a/src/cadwork/facet_list.pyi +++ b/src/cadwork/facet_list.pyi @@ -5,7 +5,6 @@ from cadwork import polygon_list from cadwork import vertex_list class facet_list: - def count(self) -> int: """count @@ -85,8 +84,5 @@ class facet_list: """ def __len__(self) -> int: ... - def __iter__(self) -> Iterator[vertex_list]: ... - def __getitem__(self, index: int) -> vertex_list: ... - diff --git a/src/cadwork/heel_shoulder_beam_geometry.pyi b/src/cadwork/heel_shoulder_beam_geometry.pyi index d07fca2..0934eeb 100644 --- a/src/cadwork/heel_shoulder_beam_geometry.pyi +++ b/src/cadwork/heel_shoulder_beam_geometry.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class heel_shoulder_beam_geometry(IntEnum): """heel shoulder beam geometry @@ -9,6 +8,7 @@ class heel_shoulder_beam_geometry(IntEnum): >>> cadwork.heel_shoulder_beam_geometry.normal normal """ + normal = 0 """NormalHeel """ @@ -18,4 +18,3 @@ class heel_shoulder_beam_geometry(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/heel_shoulder_options.pyi b/src/cadwork/heel_shoulder_options.pyi index 93773e3..ebbe8b0 100644 --- a/src/cadwork/heel_shoulder_options.pyi +++ b/src/cadwork/heel_shoulder_options.pyi @@ -1,5 +1,4 @@ class heel_shoulder_options: - def get_beam_geometry(self) -> 'shoulder_beam_geometry': """get beam geometry @@ -203,4 +202,3 @@ class heel_shoulder_options: Returns: None """ - diff --git a/src/cadwork/hit_result.pyi b/src/cadwork/hit_result.pyi index 1272559..3eed4d3 100644 --- a/src/cadwork/hit_result.pyi +++ b/src/cadwork/hit_result.pyi @@ -1,8 +1,6 @@ from cadwork.point_3d import point_3d - class hit_result: - def get_hit_element_ids(self) -> list[int]: """Get hit element IDs. diff --git a/src/cadwork/hundegger_machine_type.pyi b/src/cadwork/hundegger_machine_type.pyi index 9e81bb5..4a453e6 100644 --- a/src/cadwork/hundegger_machine_type.pyi +++ b/src/cadwork/hundegger_machine_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class hundegger_machine_type(IntEnum): """hundegger machine type @@ -9,6 +8,7 @@ class hundegger_machine_type(IntEnum): >>> cadwork.hundegger_machine_type.p8_10 p8_10 """ + p8_10 = 1 """""" k1 = 2 @@ -40,4 +40,3 @@ class hundegger_machine_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/ifc_2x3_element_type.pyi b/src/cadwork/ifc_2x3_element_type.pyi index 741b053..77d6564 100644 --- a/src/cadwork/ifc_2x3_element_type.pyi +++ b/src/cadwork/ifc_2x3_element_type.pyi @@ -1,5 +1,4 @@ class ifc_2x3_element_type: - def is_none(self) -> bool: """is none @@ -407,7 +406,7 @@ class ifc_2x3_element_type: """ def __repr__(self) -> str: - """ repr + """repr Returns: str @@ -426,4 +425,3 @@ class ifc_2x3_element_type: Returns: None """ - diff --git a/src/cadwork/ifc_element_combine_behaviour.pyi b/src/cadwork/ifc_element_combine_behaviour.pyi index 8f576ff..ecd3873 100644 --- a/src/cadwork/ifc_element_combine_behaviour.pyi +++ b/src/cadwork/ifc_element_combine_behaviour.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class ifc_element_combine_behaviour(IntEnum): """ifc element combine behaviour @@ -9,6 +8,7 @@ class ifc_element_combine_behaviour(IntEnum): >>> cadwork.ifc_element_combine_behaviour.element_module element_module """ + element_module = 0 """""" element_assembly = 1 @@ -16,4 +16,3 @@ class ifc_element_combine_behaviour(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/ifc_material_definition.pyi b/src/cadwork/ifc_material_definition.pyi index e23941a..0dbe0d3 100644 --- a/src/cadwork/ifc_material_definition.pyi +++ b/src/cadwork/ifc_material_definition.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class ifc_material_definition(IntEnum): """ifc material definition @@ -9,6 +8,7 @@ class ifc_material_definition(IntEnum): >>> cadwork.ifc_material_definition.ignore ignore """ + ignore = 1 """""" material_layer_set = 2 @@ -18,4 +18,3 @@ class ifc_material_definition(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/ifc_options.pyi b/src/cadwork/ifc_options.pyi index 18ec643..112d0d2 100644 --- a/src/cadwork/ifc_options.pyi +++ b/src/cadwork/ifc_options.pyi @@ -3,9 +3,7 @@ from cadwork.ifc_options_level_of_detail import ifc_options_level_of_detail from cadwork.ifc_options_project_data import ifc_options_project_data from cadwork.ifc_options_properties import ifc_options_properties - class ifc_options: - def get_ifc_options_properties(self) -> ifc_options_properties: """Get IFC options properties. diff --git a/src/cadwork/ifc_options_aggregation.pyi b/src/cadwork/ifc_options_aggregation.pyi index ceb8622..41fd8d7 100644 --- a/src/cadwork/ifc_options_aggregation.pyi +++ b/src/cadwork/ifc_options_aggregation.pyi @@ -2,7 +2,6 @@ from cadwork import element_grouping_type, ifc_material_definition from cadwork import ifc_element_combine_behaviour class ifc_options_aggregation: - def get_export_cover_geometry(self) -> bool: """get export cover geometry @@ -87,4 +86,3 @@ class ifc_options_aggregation: Returns: ifc_material_definition """ - diff --git a/src/cadwork/ifc_options_level_of_detail.pyi b/src/cadwork/ifc_options_level_of_detail.pyi index 25f7160..9723ecd 100644 --- a/src/cadwork/ifc_options_level_of_detail.pyi +++ b/src/cadwork/ifc_options_level_of_detail.pyi @@ -1,5 +1,4 @@ class ifc_options_level_of_detail: - def get_export_vba_drillings(self) -> bool: """get export vba drillings @@ -17,7 +16,9 @@ class ifc_options_level_of_detail: None """ - def set_export_installation_rectangular_materialization(self, export_installation_rectangular_materialization: bool) -> None: + def set_export_installation_rectangular_materialization( + self, export_installation_rectangular_materialization: bool + ) -> None: """set export installation rectangular materialization Parameters: @@ -169,4 +170,3 @@ class ifc_options_level_of_detail: Returns: None """ - diff --git a/src/cadwork/ifc_options_project_data.pyi b/src/cadwork/ifc_options_project_data.pyi index b70c8e2..e0c6ea8 100644 --- a/src/cadwork/ifc_options_project_data.pyi +++ b/src/cadwork/ifc_options_project_data.pyi @@ -1,5 +1,4 @@ class ifc_options_project_data: - def get_export_coordinates_in_ifc_site(self) -> bool: """get export coordinates in ifc site @@ -67,4 +66,3 @@ class ifc_options_project_data: Returns: None """ - diff --git a/src/cadwork/ifc_options_properties.pyi b/src/cadwork/ifc_options_properties.pyi index c13697f..5b0b62a 100644 --- a/src/cadwork/ifc_options_properties.pyi +++ b/src/cadwork/ifc_options_properties.pyi @@ -1,5 +1,4 @@ class ifc_options_properties: - def get_attriubte_nr_ifc_tag(self) -> int: """get attriubte nr ifc tag diff --git a/src/cadwork/ifc_predefined_type.pyi b/src/cadwork/ifc_predefined_type.pyi index d221b8e..dc093ea 100644 --- a/src/cadwork/ifc_predefined_type.pyi +++ b/src/cadwork/ifc_predefined_type.pyi @@ -1,5 +1,4 @@ class ifc_predefined_type: - def is_none(self) -> bool: """is none @@ -2253,4 +2252,3 @@ class ifc_predefined_type: Returns: None """ - diff --git a/src/cadwork/import_3dc_options.pyi b/src/cadwork/import_3dc_options.pyi index 0869486..830ed08 100644 --- a/src/cadwork/import_3dc_options.pyi +++ b/src/cadwork/import_3dc_options.pyi @@ -1,5 +1,4 @@ class import_3dc_options: - def set_import_saved_2d_planes(self, value: bool) -> None: """set import saved 2d planes @@ -67,4 +66,3 @@ class import_3dc_options: Returns: bool """ - diff --git a/src/cadwork/language.pyi b/src/cadwork/language.pyi index 41b6d5d..cd1527f 100644 --- a/src/cadwork/language.pyi +++ b/src/cadwork/language.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class language(IntEnum): """Available cadwork UI languages for set_language(). @@ -11,6 +10,7 @@ class language(IntEnum): >>> cadwork.language.german german """ + english = 0 """en""" german = 1 diff --git a/src/cadwork/layer_settings.pyi b/src/cadwork/layer_settings.pyi index 808ed66..7040147 100644 --- a/src/cadwork/layer_settings.pyi +++ b/src/cadwork/layer_settings.pyi @@ -1,5 +1,4 @@ class layer_settings: - def get_layer(self) -> int: """get layer @@ -72,4 +71,3 @@ class layer_settings: Returns: None """ - diff --git a/src/cadwork/multi_layer_cover_type.pyi b/src/cadwork/multi_layer_cover_type.pyi index c632e97..ce459aa 100644 --- a/src/cadwork/multi_layer_cover_type.pyi +++ b/src/cadwork/multi_layer_cover_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class multi_layer_cover_type(IntEnum): """multi layer cover type @@ -9,6 +8,7 @@ class multi_layer_cover_type(IntEnum): >>> cadwork.multi_layer_cover_type.framedWall framedWall """ + framedWall = 0 """""" solidWall = 1 @@ -26,4 +26,3 @@ class multi_layer_cover_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/multi_layer_subtype.pyi b/src/cadwork/multi_layer_subtype.pyi index 05ad725..7938e3e 100644 --- a/src/cadwork/multi_layer_subtype.pyi +++ b/src/cadwork/multi_layer_subtype.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class multi_layer_subtype(IntEnum): """multi layer subtype @@ -8,7 +7,8 @@ class multi_layer_subtype(IntEnum): Examples: >>> cadwork.multi_layer_subtype.undefined undefined - """ + """ + undefined = 0 """""" loadBearingFrameStructure = 1 @@ -30,4 +30,3 @@ class multi_layer_subtype(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/multi_layer_type.pyi b/src/cadwork/multi_layer_type.pyi index a0128f1..b22b4e5 100644 --- a/src/cadwork/multi_layer_type.pyi +++ b/src/cadwork/multi_layer_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class multi_layer_type(IntEnum): """multi layer type @@ -9,6 +8,7 @@ class multi_layer_type(IntEnum): >>> cadwork.multi_layer_type.undefined undefined """ + undefined = 0 """""" structure = 1 @@ -24,4 +24,3 @@ class multi_layer_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/node_symbol.pyi b/src/cadwork/node_symbol.pyi index d2eddfc..b0c8df3 100644 --- a/src/cadwork/node_symbol.pyi +++ b/src/cadwork/node_symbol.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class node_symbol(IntEnum): """node symbol @@ -9,6 +8,7 @@ class node_symbol(IntEnum): >>> cadwork.node_symbol.SmallSquare SmallSquare """ + SmallSquare = 1 """""" Square = 2 @@ -30,4 +30,3 @@ class node_symbol(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/panel_prefab_element_data.pyi b/src/cadwork/panel_prefab_element_data.pyi index 3b6125c..d5087f0 100644 --- a/src/cadwork/panel_prefab_element_data.pyi +++ b/src/cadwork/panel_prefab_element_data.pyi @@ -1,6 +1,5 @@ from cadwork.panel_prefab_element_type import panel_prefab_element_type - class panel_prefab_element_data: """Read-only machine panel prefabrication data of an element. diff --git a/src/cadwork/panel_prefab_element_settings.pyi b/src/cadwork/panel_prefab_element_settings.pyi index 9cc5a50..934b3b1 100644 --- a/src/cadwork/panel_prefab_element_settings.pyi +++ b/src/cadwork/panel_prefab_element_settings.pyi @@ -1,6 +1,5 @@ from cadwork.panel_prefab_element_type import panel_prefab_element_type - class panel_prefab_element_settings: """Machine panel prefabrication settings passed to the setter. diff --git a/src/cadwork/panel_prefab_element_type.pyi b/src/cadwork/panel_prefab_element_type.pyi index e5eada7..a14575f 100644 --- a/src/cadwork/panel_prefab_element_type.pyi +++ b/src/cadwork/panel_prefab_element_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class panel_prefab_element_type(IntEnum): """panel prefab element type @@ -11,6 +10,7 @@ class panel_prefab_element_type(IntEnum): >>> cadwork.panel_prefab_element_type.batten batten """ + none = 0 """""" frame = 1 diff --git a/src/cadwork/point_2d.pyi b/src/cadwork/point_2d.pyi index 2349c98..ba38b7d 100644 --- a/src/cadwork/point_2d.pyi +++ b/src/cadwork/point_2d.pyi @@ -5,7 +5,7 @@ class point_2d: passed instead: it is implicitly converted to a point_2d. """ - def __init__(self, u: float = 0., v: float = 0.): + def __init__(self, u: float = 0.0, v: float = 0.0): """ Initialize an instance of a point_2d. diff --git a/src/cadwork/polygon_list.pyi b/src/cadwork/polygon_list.pyi index dab4975..860c224 100644 --- a/src/cadwork/polygon_list.pyi +++ b/src/cadwork/polygon_list.pyi @@ -2,9 +2,7 @@ from typing import Iterator from cadwork import vertex_list - class polygon_list: - def count(self) -> int: """Returns the number of polygons in the list. @@ -22,7 +20,5 @@ class polygon_list: """ def __len__(self) -> int: ... - def __iter__(self) -> Iterator[vertex_list]: ... - def __getitem__(self, index: int) -> vertex_list: ... diff --git a/src/cadwork/process_type.pyi b/src/cadwork/process_type.pyi index c2c2e00..4188a86 100644 --- a/src/cadwork/process_type.pyi +++ b/src/cadwork/process_type.pyi @@ -1,5 +1,4 @@ class process_type: - def set_none(self) -> None: """set none @@ -307,4 +306,3 @@ class process_type: Returns: bool """ - diff --git a/src/cadwork/projection_type.pyi b/src/cadwork/projection_type.pyi index 7edbd64..9a22f22 100644 --- a/src/cadwork/projection_type.pyi +++ b/src/cadwork/projection_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class projection_type(IntEnum): """projection type @@ -9,6 +8,7 @@ class projection_type(IntEnum): >>> cadwork.projection_type.Perspective Perspective """ + Perspective = 1 """""" Orthographic = 2 @@ -16,4 +16,3 @@ class projection_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/rhino_options.pyi b/src/cadwork/rhino_options.pyi index 2e6c382..b74162e 100644 --- a/src/cadwork/rhino_options.pyi +++ b/src/cadwork/rhino_options.pyi @@ -1,5 +1,4 @@ class rhino_options: - def get_materialize_end_types(self) -> bool: """get materialize end types @@ -84,4 +83,3 @@ class rhino_options: Returns: None """ - diff --git a/src/cadwork/shortcut_key.pyi b/src/cadwork/shortcut_key.pyi index b8fc57f..3fe0d45 100644 --- a/src/cadwork/shortcut_key.pyi +++ b/src/cadwork/shortcut_key.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class shortcut_key(IntEnum): """shortcut key @@ -9,6 +8,7 @@ class shortcut_key(IntEnum): >>> cadwork.shortcut_key.F1 F1 """ + F1 = 1 """""" F2 = 2 @@ -36,4 +36,3 @@ class shortcut_key(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/shortcut_key_modifier.pyi b/src/cadwork/shortcut_key_modifier.pyi index 68dbc62..c80feee 100644 --- a/src/cadwork/shortcut_key_modifier.pyi +++ b/src/cadwork/shortcut_key_modifier.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class shortcut_key_modifier(IntEnum): """shortcut key modifier @@ -9,6 +8,7 @@ class shortcut_key_modifier(IntEnum): >>> cadwork.shortcut_key_modifier.shift shift """ + shift = 1 """""" ctrl = 2 @@ -18,4 +18,3 @@ class shortcut_key_modifier(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/shoulder_beam_geometry.pyi b/src/cadwork/shoulder_beam_geometry.pyi index 28deb23..e38be78 100644 --- a/src/cadwork/shoulder_beam_geometry.pyi +++ b/src/cadwork/shoulder_beam_geometry.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class shoulder_beam_geometry(IntEnum): """shoulder beam geometry @@ -25,4 +24,3 @@ class shoulder_beam_geometry(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/shoulder_drilling_orientation.pyi b/src/cadwork/shoulder_drilling_orientation.pyi index b2d60d2..4bd8399 100644 --- a/src/cadwork/shoulder_drilling_orientation.pyi +++ b/src/cadwork/shoulder_drilling_orientation.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class shoulder_drilling_orientation(IntEnum): """shoulder drilling orientation @@ -9,6 +8,7 @@ class shoulder_drilling_orientation(IntEnum): >>> cadwork.shoulder_drilling_orientation.perpendicular_to_bisector perpendicular_to_bisector """ + perpendicular_to_bisector = 1 """""" perpendicular_to_counter_part = 2 @@ -20,4 +20,3 @@ class shoulder_drilling_orientation(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/shoulder_options.pyi b/src/cadwork/shoulder_options.pyi index f79be86..c5105a0 100644 --- a/src/cadwork/shoulder_options.pyi +++ b/src/cadwork/shoulder_options.pyi @@ -1,5 +1,4 @@ class shoulder_options: - def get_add_drilling_axis(self) -> bool: """get add drilling axis @@ -339,4 +338,3 @@ class shoulder_options: Returns: None """ - diff --git a/src/cadwork/standard_element_type.pyi b/src/cadwork/standard_element_type.pyi index a30d3e9..3853e5e 100644 --- a/src/cadwork/standard_element_type.pyi +++ b/src/cadwork/standard_element_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class standard_element_type(IntEnum): """standard element type @@ -9,6 +8,7 @@ class standard_element_type(IntEnum): >>> cadwork.standard_element_type.beam beam """ + beam = 0 """""" panel = 2 @@ -24,4 +24,3 @@ class standard_element_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/text_element_type.pyi b/src/cadwork/text_element_type.pyi index 7256fd6..e04fc72 100644 --- a/src/cadwork/text_element_type.pyi +++ b/src/cadwork/text_element_type.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class text_element_type(IntEnum): """text element type @@ -9,6 +8,7 @@ class text_element_type(IntEnum): >>> cadwork.text_element_type.line line """ + line = 0 """""" surface = 1 @@ -20,4 +20,3 @@ class text_element_type(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/text_object_options.pyi b/src/cadwork/text_object_options.pyi index 61bce78..5de97f2 100644 --- a/src/cadwork/text_object_options.pyi +++ b/src/cadwork/text_object_options.pyi @@ -1,7 +1,6 @@ from cadwork import text_element_type class text_object_options: - def set_font_name(self, font_name: str) -> None: """set font name diff --git a/src/cadwork/vba_catalog_item_type.pyi b/src/cadwork/vba_catalog_item_type.pyi index 7728235..6707326 100644 --- a/src/cadwork/vba_catalog_item_type.pyi +++ b/src/cadwork/vba_catalog_item_type.pyi @@ -1,14 +1,14 @@ from enum import IntEnum, unique - @unique class vba_catalog_item_type(IntEnum): - """ Enumeration for vba item types. + """Enumeration for vba item types. Examples: >>> cadwork.vba_catalog_item_type.nut nut """ + null = 0 """""" nut = 1 diff --git a/src/cadwork/vertex_list.pyi b/src/cadwork/vertex_list.pyi index fd6e7d8..6b05cf5 100644 --- a/src/cadwork/vertex_list.pyi +++ b/src/cadwork/vertex_list.pyi @@ -3,7 +3,6 @@ from typing import Iterator from cadwork import point_3d class vertex_list: - def count(self) -> int: """count @@ -32,8 +31,5 @@ class vertex_list: """ def __len__(self) -> int: ... - def __iter__(self) -> Iterator[point_3d]: ... - def __getitem__(self, index: int) -> point_3d: ... - diff --git a/src/cadwork/weinmann_mfb_version.pyi b/src/cadwork/weinmann_mfb_version.pyi index 82a7a30..4f60f07 100644 --- a/src/cadwork/weinmann_mfb_version.pyi +++ b/src/cadwork/weinmann_mfb_version.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class weinmann_mfb_version(IntEnum): """weinmann mfb version @@ -9,6 +8,7 @@ class weinmann_mfb_version(IntEnum): >>> cadwork.weinmann_mfb_version.wup_2_0 wup_2_0 """ + wup_2_0 = 20 """""" wup_3_1 = 31 @@ -22,4 +22,3 @@ class weinmann_mfb_version(IntEnum): def __int__(self) -> int: return self.value - diff --git a/src/cadwork/window_geometry.pyi b/src/cadwork/window_geometry.pyi index faec5ea..93afb75 100644 --- a/src/cadwork/window_geometry.pyi +++ b/src/cadwork/window_geometry.pyi @@ -1,6 +1,5 @@ from cadwork import point - class window_geometry: def __init__(self, bottom_left: point, bottom_right: point, top_left: point, top_right: point): """ @@ -15,4 +14,4 @@ class window_geometry: self.bottom_left = bottom_left self.bottom_right = bottom_right self.top_left = top_left - self.top_right = top_right \ No newline at end of file + self.top_right = top_right diff --git a/src/cadwork/working_plane_exit_view.pyi b/src/cadwork/working_plane_exit_view.pyi index aed102b..09ff510 100644 --- a/src/cadwork/working_plane_exit_view.pyi +++ b/src/cadwork/working_plane_exit_view.pyi @@ -1,6 +1,5 @@ from enum import IntEnum, unique - @unique class working_plane_exit_view(IntEnum): """working plane exit view @@ -9,6 +8,7 @@ class working_plane_exit_view(IntEnum): >>> cadwork.working_plane_exit_view.previous_view previous_view """ + previous_view = 0 """Restores the view and controller active before entering.""" standard_axonometry = 1 diff --git a/src/connector_axis_controller/__init__.pyi b/src/connector_axis_controller/__init__.pyi index 0768882..997f80e 100644 --- a/src/connector_axis_controller/__init__.pyi +++ b/src/connector_axis_controller/__init__.pyi @@ -24,7 +24,6 @@ def create_standard_connector(axis_name: str, point1: point_3d, point2: point_3d The element id of the created standard connector axis. """ - def set_bolt_length(axis_id: ElementId, length: float) -> None: """Sets the Bolt Length. @@ -33,7 +32,6 @@ def set_bolt_length(axis_id: ElementId, length: float) -> None: length: The bolt length. """ - def set_bolt_length_automatic(axis_id: ElementId, length_automatic: bool) -> None: """Sets the Bolt Length Automatic. @@ -42,7 +40,6 @@ def set_bolt_length_automatic(axis_id: ElementId, length_automatic: bool) -> Non length_automatic: True if the bolt length should be automatic, false otherwise. """ - def set_diameter(axis_id: ElementId, diameter: float) -> None: """Sets the Drilling Diameter for all Sections. @@ -51,7 +48,6 @@ def set_diameter(axis_id: ElementId, diameter: float) -> None: diameter: The drilling diameter to set for all sections. """ - def set_section_diameter(axis_id: ElementId, section_index: UnsignedInt, diameter: float) -> None: """Sets the Drilling Diameter for a specific Sections. @@ -61,7 +57,6 @@ def set_section_diameter(axis_id: ElementId, section_index: UnsignedInt, diamete diameter: The drilling diameter to set for the specific section. """ - def check_axis(axis_id: ElementId) -> bool: """Returns if the axis is valid. @@ -72,11 +67,8 @@ def check_axis(axis_id: ElementId) -> bool: True if the axis is valid, false otherwise. """ - def clear_errors() -> None: - """Clear all errors. - """ - + """Clear all errors.""" def update_axis_cutting_ability(axis_id_list: list[ElementId]) -> None: """Updates the Connection Config (CuttingAbility) of Axis/VBAs. @@ -85,7 +77,6 @@ def update_axis_cutting_ability(axis_id_list: list[ElementId]) -> None: axis_id_list: The axis id list. """ - def set_bolt_item(axis_id: ElementId, item_guid: str) -> None: """Sets the Bolt Item. @@ -94,7 +85,6 @@ def set_bolt_item(axis_id: ElementId, item_guid: str) -> None: item_guid: The bolt item guid to set. """ - def create_blank_connector(diameter: float, start_point: point_3d, end_point: point_3d) -> ElementId: """Creates a blank connector between two points. @@ -107,7 +97,6 @@ def create_blank_connector(diameter: float, start_point: point_3d, end_point: po The element id of the created blank connector. """ - def import_from_file(file_path: str) -> None: """Import from file. @@ -115,11 +104,8 @@ def import_from_file(file_path: str) -> None: file_path: The path to the file to import. """ - def start_configuration_dialog() -> None: - """Starts the ConnectorAxis configuration dialog. - """ - + """Starts the ConnectorAxis configuration dialog.""" def get_item_guid_by_name(name: str, item_type: vba_catalog_item_type) -> str: """Get item guid by name. @@ -132,7 +118,6 @@ def get_item_guid_by_name(name: str, item_type: vba_catalog_item_type) -> str: The guid of the item. """ - def get_bolt_length(axis_id: ElementId) -> float: """Gets the Bolt Length. @@ -143,7 +128,6 @@ def get_bolt_length(axis_id: ElementId) -> float: The bolt length. """ - def get_bolt_over_length(axis_id: ElementId) -> float: """Gets the Bolt OverLength. @@ -154,7 +138,6 @@ def get_bolt_over_length(axis_id: ElementId) -> float: The bolt over length. """ - def set_bolt_over_length(axis_id: ElementId, over_length: float) -> None: """Sets the Bolt OverLength. @@ -163,7 +146,6 @@ def set_bolt_over_length(axis_id: ElementId, over_length: float) -> None: over_length: The bolt over length. """ - def get_bolt_length_automatic(axis_id: ElementId) -> bool: """Returns if Bolt Length Automatic is set. @@ -174,7 +156,6 @@ def get_bolt_length_automatic(axis_id: ElementId) -> bool: True if the bolt length is automatic, false otherwise. """ - def get_bolt_item_guid(axis_id: ElementId) -> str: """Gets the Guid of the Bolt Item. @@ -185,7 +166,6 @@ def get_bolt_item_guid(axis_id: ElementId) -> str: The guid of the bolt item. """ - def get_section_diameter(axis_id: ElementId, section_index: UnsignedInt) -> float: """Gets the Drilling Diameter of a specific Sections. @@ -197,7 +177,6 @@ def get_section_diameter(axis_id: ElementId, section_index: UnsignedInt) -> floa The drilling diameter of the specified section. """ - def get_axis_items_guids(axis_id: ElementId) -> list[str]: """Returns a list of GUIDs of all axis items. @@ -208,7 +187,6 @@ def get_axis_items_guids(axis_id: ElementId) -> list[str]: The list of GUIDs of all axis items. """ - def get_axis_item_name(guid: str) -> str: """Returns the name of an axis item. @@ -219,7 +197,6 @@ def get_axis_item_name(guid: str) -> str: The name of the axis item. """ - def get_axis_item_material(guid: str) -> str: """Returns the material of an axis item. @@ -230,7 +207,6 @@ def get_axis_item_material(guid: str) -> str: The material of the axis item. """ - def get_axis_item_norm(guid: str) -> str: """Returns the norm of an axis item. @@ -241,7 +217,6 @@ def get_axis_item_norm(guid: str) -> str: The norm of the axis item. """ - def get_axis_item_strength_category(guid: str) -> str: """Returns the strength category of an axis item. @@ -252,7 +227,6 @@ def get_axis_item_strength_category(guid: str) -> str: The strength category of the axis item. """ - def get_axis_item_user_field(guid: str, user_item_number: int) -> str: """Returns an userfield value of an axis item. @@ -264,7 +238,6 @@ def get_axis_item_user_field(guid: str, user_item_number: int) -> str: The user field value. """ - def get_axis_item_order_number(guid: str) -> str: """Returns the strength category of an axis item. @@ -275,7 +248,6 @@ def get_axis_item_order_number(guid: str) -> str: The strength category of the axis item. """ - def get_bolt_order_number(axis_id: ElementId) -> str: """Returns the ordernumber of a bolt item. @@ -286,7 +258,6 @@ def get_bolt_order_number(axis_id: ElementId) -> str: The order number of the bolt item. """ - def get_section_count(axis_id: ElementId) -> int: """Returns the number of sections. @@ -297,7 +268,6 @@ def get_section_count(axis_id: ElementId) -> int: The number of sections of the axis. """ - def get_section_material_name(axis_id: ElementId, section_index: UnsignedInt) -> str: """Returns material of a section contact element. @@ -309,7 +279,6 @@ def get_section_material_name(axis_id: ElementId, section_index: UnsignedInt) -> The material of the section contact element. """ - def get_section_contact_element(axis_id: float, section_index: UnsignedInt) -> ElementId: """Gets the section contact element. @@ -321,7 +290,6 @@ def get_section_contact_element(axis_id: float, section_index: UnsignedInt) -> E The element id of the section contact element. """ - def get_bolt_diameter(axis_id: ElementId) -> float: """Gets the bolt diameter. @@ -339,7 +307,6 @@ def get_standard_connector_list() -> list[str]: The list of standard connector names. """ - def get_counterbore_diameter_for_start_side(axis_id: ElementId, section_index: UnsignedInt) -> float: """Gets the counterbore diameter for the start side. @@ -354,7 +321,6 @@ def get_counterbore_diameter_for_start_side(axis_id: ElementId, section_index: U The counterbore diameter for the start side. """ - def get_counterbore_diameter_for_end_side(axis_id: ElementId, section_index: UnsignedInt) -> float: """Gets the counterbore diameter for the end side of a section. @@ -366,7 +332,6 @@ def get_counterbore_diameter_for_end_side(axis_id: ElementId, section_index: Uns The counterbore diameter for the end side. """ - def get_counterbore_depth_for_start_side(axis_id: ElementId, section_index: UnsignedInt) -> float: """Gets the counterbore depth for the start side. @@ -378,7 +343,6 @@ def get_counterbore_depth_for_start_side(axis_id: ElementId, section_index: Unsi The counterbore depth for the start side. """ - def get_counterbore_depth_for_end_side(axis_id: ElementId, section_index: UnsignedInt) -> float: """Gets the counterbore depth for the end side. @@ -401,7 +365,6 @@ def get_counterbore_is_conical_for_start_side(axis_id: ElementId, section_index: True if the counterbore is conical for the start side, false otherwise. """ - def get_counterbore_is_conical_for_end_side(axis_id: ElementId, section_index: UnsignedInt) -> bool: """Get if counterbore is conical for end side. @@ -411,11 +374,11 @@ def get_counterbore_is_conical_for_end_side(axis_id: ElementId, section_index: U Returns: True if the counterbore is conical for the end side, false otherwise. - """ - + """ -def set_counterbore_for_start_side(axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, - is_conical: bool) -> None: +def set_counterbore_for_start_side( + axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, is_conical: bool +) -> None: """Sets the counterbore for the start side. Parameters: @@ -426,9 +389,9 @@ def set_counterbore_for_start_side(axis_id: ElementId, section_index: UnsignedIn is_conical: True if the counterbore is conical, false otherwise. """ - -def set_counterbore_for_end_side(axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, - is_conical: bool) -> None: +def set_counterbore_for_end_side( + axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, is_conical: bool +) -> None: """Sets the counterbore for the end side. Parameters: @@ -439,7 +402,6 @@ def set_counterbore_for_end_side(axis_id: ElementId, section_index: UnsignedInt, is_conical: True if the counterbore is conical, false otherwise. """ - def get_intersection_count(intersection_index: UnsignedInt) -> int: """Get the intersection count. @@ -461,7 +423,6 @@ def get_item_guids_at_intersection(axis_id: ElementId, intersection_index: Unsig The list of item GUIDs at the intersection. """ - def set_item_guids_at_intersection(axis_id: ElementId, intersection_index: UnsignedInt, item_guids: list[str]) -> None: """Sets item GUIDs at intersection. @@ -482,7 +443,6 @@ def get_section_length(axis_id: ElementId, section_index: UnsignedInt) -> float: The length of the section. """ - def get_section_oblong_drilling_is_enabled(axis_id: ElementId, section_index: UnsignedInt) -> bool: """Get if the section oblong drilling is enabled. @@ -494,7 +454,6 @@ def get_section_oblong_drilling_is_enabled(axis_id: ElementId, section_index: Un True if the section oblong drilling is enabled, false otherwise. """ - def get_section_oblong_drilling_positive_value(axis_id: ElementId, section_index: UnsignedInt) -> float: """Get section oblong drilling positive value. @@ -506,7 +465,6 @@ def get_section_oblong_drilling_positive_value(axis_id: ElementId, section_index The positive value of the section oblong drilling. """ - def get_section_oblong_drilling_negative_value(axis_id: ElementId, section_index: UnsignedInt) -> float: """Get the section oblong drilling negative value @@ -518,7 +476,6 @@ def get_section_oblong_drilling_negative_value(axis_id: ElementId, section_index The negative value of the section oblong drilling. """ - def get_section_oblong_drilling_angle(axis_id: ElementId, section_index: UnsignedInt) -> float: """Get section oblong drilling angle. @@ -530,7 +487,6 @@ def get_section_oblong_drilling_angle(axis_id: ElementId, section_index: Unsigne The angle of the section oblong drilling. """ - def set_section_oblong_drilling_is_disabled(axis_id: ElementId, section_index: UnsignedInt) -> None: """Disable the section oblong drilling. @@ -539,9 +495,9 @@ def set_section_oblong_drilling_is_disabled(axis_id: ElementId, section_index: U section_index: The index of the section. (0-based index) """ - -def set_section_oblong_drilling_is_enabled(axis_id: ElementId, section_index: UnsignedInt, positive_value: float, - negative_value: float, angle: float) -> None: +def set_section_oblong_drilling_is_enabled( + axis_id: ElementId, section_index: UnsignedInt, positive_value: float, negative_value: float, angle: float +) -> None: """Enable the section oblong drilling with parameters. Parameters: @@ -552,8 +508,9 @@ def set_section_oblong_drilling_is_enabled(axis_id: ElementId, section_index: Un angle: The angle of the section oblong drilling. """ - -def set_items_at_intersection(axis_id: ElementId, intersection_index: UnsignedInt, items: list[connector_axis_item]) -> None: +def set_items_at_intersection( + axis_id: ElementId, intersection_index: UnsignedInt, items: list[connector_axis_item] +) -> None: """Sets item at intersection. Parameters: diff --git a/src/dimension_controller/__init__.pyi b/src/dimension_controller/__init__.pyi index ecd3783..856d5f7 100644 --- a/src/dimension_controller/__init__.pyi +++ b/src/dimension_controller/__init__.pyi @@ -11,10 +11,12 @@ from cadwork.point_3d import point_3d from cadwork.dimension_base_format import dimension_base_format from cadwork.api_types import * -def create_dimension(xl: point_3d, plane_normal: point_3d, distance: point_3d, dimension_points: list[point_3d]) -> ElementId: +def create_dimension( + xl: point_3d, plane_normal: point_3d, distance: point_3d, dimension_points: list[point_3d] +) -> ElementId: """Creates a dimension element to measure distances on 3D parts. - The dimension is drawn on a plane - defined by its normal and offset distance. Points added to the dimension are projected + The dimension is drawn on a plane + defined by its normal and offset distance. Points added to the dimension are projected onto this plane, and dimension segments are automatically created between consecutive points. Parameters: @@ -22,11 +24,11 @@ def create_dimension(xl: point_3d, plane_normal: point_3d, distance: point_3d, d plane_normal: The normal vector defining the orientation of the dimension plane. distance: The offset vector from the dimensioned geometry to where the dimension line is drawn. Can offset in any direction. dimension_points: A list of dimension points to measure. At least 2 points are needed for a valid dimension measurement, but the points can be added later using addSegment(). Points are projected onto the dimension plane. - - Examples: + + Examples: >>> import cadwork >>> import dimension_controller as dc - + >>> # Create a list of dimension points >>> list_points = [] >>> list_points.append(cadwork.point_3d(0., 0., 0.)) @@ -58,12 +60,12 @@ def set_orientation(element_id_list: list[ElementId], view_dir: point_3d, view_d """ def add_segment(element_id: ElementId, segment: point_3d) -> None: - """Adds a new point to a dimension's point list. A dimension segment is automatically - created between this point and the previous point. This method can be called multiple times + """Adds a new point to a dimension's point list. A dimension segment is automatically + created between this point and the previous point. This method can be called multiple times to progressively add more measurement points to the dimension. Parameters: - element_id: The element id. + element_id: The element id. segment: The point to add to the dimension (despite the parameter name, this is a point, not a segment). """ @@ -113,7 +115,7 @@ def set_line_color(element_id_list: list[ElementId], color_id: ColorId) -> None: Parameters: element_id_list: The element id list. color_id: The color id to set. - """ + """ def set_default_anchor_length(element_id_list: list[ElementId], length: float) -> None: """Sets the default anchor length of a dimension element. @@ -153,7 +155,7 @@ def get_default_anchor_length(element_id: ElementId) -> float: """Gets the default anchor length. Parameters: - element_id: The element id. + element_id: The element id. Returns: The default anchor length. @@ -163,7 +165,7 @@ def get_distance(element_id: ElementId) -> point_3d: """Get the distance to the dimension reference point. The point is in the plane of the dimensioning. Parameters: - element_id: The element id. + element_id: The element id. Returns: The distance vector. @@ -173,7 +175,7 @@ def get_plane_normal(element_id: ElementId) -> point_3d: """Get the plane normal. Parameters: - element_id: The element id. + element_id: The element id. Returns: The plane normal vector. @@ -183,7 +185,7 @@ def get_plane_xl(element_id: ElementId) -> point_3d: """Get the plane x direction. Parameters: - element_id: The element id. + element_id: The element id. Returns: The plane x direction vector. @@ -193,7 +195,7 @@ def get_segment_count(element_id: ElementId) -> int: """Get count of segments. Parameters: - element_id: The element id. + element_id: The element id. Returns: The number of segments. @@ -225,18 +227,17 @@ def get_total_dimension(element_id: ElementId) -> bool: """Query whether the visualisation of the overall dimension is set for a dimension element. Parameters: - element_id: The element id. + element_id: The element id. Returns: True if the visualisation is set, false otherwise. For elements that are not of type dimension, the return value is per default false. """ - def get_dimension_base_format(element_id: ElementId) -> dimension_base_format: """Get the dimension base format. Parameters: - element_id: The element id. + element_id: The element id. Returns: The format used for the dimension. Enum value `None` may indicate that something went wrong while retrieving the value due to e.g. the element not being a valid dimension. diff --git a/src/element_controller/__init__.pyi b/src/element_controller/__init__.pyi index 503c152..cf2128f 100644 --- a/src/element_controller/__init__.pyi +++ b/src/element_controller/__init__.pyi @@ -36,7 +36,7 @@ def delete_elements(element_id_list: list[ElementId]) -> None: def join_elements(element_id_list: list[ElementId]) -> None: """Joins the specified elements together. - + Parameters: element_id_list: The element id list. """ @@ -48,7 +48,9 @@ def join_top_level_elements(element_id_list: list[ElementId]) -> None: element_id_list: The element id list. """ -def create_rectangular_beam_points(width: float, height: float, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_rectangular_beam_points( + width: float, height: float, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a rectangular beam using points. Parameters: @@ -73,7 +75,9 @@ def create_rectangular_beam_points(width: float, height: float, first_point: poi The ID of the created rectangular beam. """ -def create_circular_beam_points(diameter: float, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_circular_beam_points( + diameter: float, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a circular beam using points. Parameters: @@ -96,7 +100,9 @@ def create_circular_beam_points(diameter: float, first_point: point_3d, second_p The ID of the created circular beam. """ -def create_square_beam_points(width: float, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_square_beam_points( + width: float, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a square beam using points. Parameters: @@ -119,7 +125,14 @@ def create_square_beam_points(width: float, first_point: point_3d, second_point: The ID of the created square beam. """ -def create_rectangular_beam_vectors(width: float, height: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_rectangular_beam_vectors( + width: float, + height: float, + length: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a rectangular beam using vectors. Parameters: @@ -143,7 +156,9 @@ def create_rectangular_beam_vectors(width: float, height: float, length: float, The ID of the created rectangular beam. """ -def create_circular_beam_vectors(diameter: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_circular_beam_vectors( + diameter: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d +) -> ElementId: """Creates a circular beam using vectors. Parameters: @@ -165,7 +180,9 @@ def create_circular_beam_vectors(diameter: float, length: float, starting_point: The ID of the created circular beam. """ -def create_square_beam_vectors(width: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_square_beam_vectors( + width: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d +) -> ElementId: """Creates a square beam using vectors. Parameters: @@ -187,7 +204,9 @@ def create_square_beam_vectors(width: float, length: float, starting_point: poin The ID of the created square beam. """ -def create_rectangular_panel_points(width: float, thickness: float, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_rectangular_panel_points( + width: float, thickness: float, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Create a rectangular panel using points. Parameters: @@ -211,7 +230,14 @@ def create_rectangular_panel_points(width: float, thickness: float, first_point: The ID of the created rectangular panel. """ -def create_rectangular_panel_vectors(width: float, thickness: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_rectangular_panel_vectors( + width: float, + thickness: float, + length: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Create a rectangular panel using vectors. Parameters: @@ -253,7 +279,9 @@ def create_drilling_points(diameter: float, first_point: point_3d, second_point: The ID of the created drilling. """ -def create_drilling_vectors(diameter: float, length: float, starting_point: point_3d, drilling_direction: point_3d) -> ElementId: +def create_drilling_vectors( + diameter: float, length: float, starting_point: point_3d, drilling_direction: point_3d +) -> ElementId: """Creates drilling using vectors. Parameters: @@ -367,8 +395,9 @@ def move_element(element_id_list: list[ElementId], move_vector: point_3d) -> Non move_vector: The vector by which to move the elements. """ - -def create_polygon_beam(polygon_vertices: vertex_list, thickness: float, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_polygon_beam( + polygon_vertices: vertex_list, thickness: float, x_local_direction: point_3d, z_local_direction: point_3d +) -> ElementId: """Creates a polygon beam. Parameters: @@ -392,8 +421,13 @@ def create_polygon_beam(polygon_vertices: vertex_list, thickness: float, x_local The ID of the created polygon beam. """ - -def create_polygon_beam_vectors(polygon_vertices: list[point_2d | tuple[float, float]], thickness: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_polygon_beam_vectors( + polygon_vertices: list[point_2d | tuple[float, float]], + thickness: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a polygon beam from a 2D profile using vectors. The profile is defined in the local uv-plane of the beam and extruded from @@ -421,7 +455,9 @@ def create_polygon_beam_vectors(polygon_vertices: list[point_2d | tuple[float, f The ID of the created polygon beam. """ -def create_text_object(text: str, position: point_3d, x_local_direction: point_3d, z_local_direction: point_3d, size: float) -> ElementId: +def create_text_object( + text: str, position: point_3d, x_local_direction: point_3d, z_local_direction: point_3d, size: float +) -> ElementId: """Creates a text object. Parameters: @@ -454,7 +490,9 @@ def copy_elements(element_id_list: list[ElementId], copy_vector: point_3d) -> li The IDs of the copied elements. """ -def rotate_elements(element_id_list: list[ElementId], origin: point_3d, rotation_axis: point_3d, rotation_angle: float) -> None: +def rotate_elements( + element_id_list: list[ElementId], origin: point_3d, rotation_axis: point_3d, rotation_angle: float +) -> None: """Rotate the provided elements around a specified axis. Parameters: @@ -522,12 +560,10 @@ def add_elements_to_undo(element_id_list: list[ElementId], cmd: int) -> None: """ def make_undo() -> None: - """Performs an undo operation, reverting the last change made. - """ + """Performs an undo operation, reverting the last change made.""" def make_redo() -> None: - """Performs a redo operation, reapplying the last undone change. - """ + """Performs a redo operation, reapplying the last undone change.""" def split_elements(element_id_list: list[ElementId]) -> None: """Splits elements. @@ -550,7 +586,9 @@ def set_line_to_normal_line(element_id_list: list[ElementId]) -> None: element_id_list: The elements to modify. """ -def create_auto_export_solid_from_standard(element_id_list: list[ElementId], output_name: str, standard_element_name: str) -> ElementId: +def create_auto_export_solid_from_standard( + element_id_list: list[ElementId], output_name: str, standard_element_name: str +) -> ElementId: """Creates an auto export solid from a standard element. Parameters: @@ -562,7 +600,9 @@ def create_auto_export_solid_from_standard(element_id_list: list[ElementId], out The element ID of the created solid. """ -def set_element_module_properties_for_elements(element_id_list: list[ElementId], properties: element_module_properties) -> None: +def set_element_module_properties_for_elements( + element_id_list: list[ElementId], properties: element_module_properties +) -> None: """Sets the element module properties for elements. Parameters: @@ -570,7 +610,9 @@ def set_element_module_properties_for_elements(element_id_list: list[ElementId], properties: The properties to set. """ -def create_text_object_with_font(text: str, position: point_3d, x_local_direction: point_3d, z_local_direction: point_3d, size: float, font_name: str) -> ElementId: +def create_text_object_with_font( + text: str, position: point_3d, x_local_direction: point_3d, z_local_direction: point_3d, size: float, font_name: str +) -> ElementId: """Creates a text object with a specific font. Parameters: @@ -594,7 +636,15 @@ def create_text_object_with_font(text: str, position: point_3d, x_local_directio The element ID of the created text object. """ -def apply_transformation_coordinate(element_id_list: list[ElementId], old_point: point_3d, old_x_local_direction: point_3d, old_y_local_direction: point_3d, new_point: point_3d, new_x_local_direction: point_3d, new_y_local_direction: point_3d) -> None: +def apply_transformation_coordinate( + element_id_list: list[ElementId], + old_point: point_3d, + old_x_local_direction: point_3d, + old_y_local_direction: point_3d, + new_point: point_3d, + new_x_local_direction: point_3d, + new_y_local_direction: point_3d, +) -> None: """Apply transformation coordinate to elements. Parameters: @@ -660,8 +710,7 @@ def get_user_element_ids_with_existing(element_id_list: list[ElementId]) -> list """ def clear_errors() -> None: - """Clears all errors. - """ + """Clears all errors.""" def glide_elements(element_id_list: list[ElementId], glide_origin_point: point_3d) -> None: """Glides elements to a specified point. @@ -682,7 +731,9 @@ def cut_elements_with_miter(first_id: ElementId, second_id: ElementId) -> bool: True if the cut operation was successful, false otherwise. """ -def cut_element_with_plane(element_id: ElementId, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> bool: +def cut_element_with_plane( + element_id: ElementId, cut_plane_normal_vector: point_3d, distance_from_global_origin: float +) -> bool: """Cut an element with a plane. Parameters: @@ -734,7 +785,9 @@ def create_rectangular_mep(width: float, depth: float, points: list[point_3d]) - The ID of the created rectangular MEP element. """ -def slice_element_with_plane(element_id: ElementId, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> bool: +def slice_element_with_plane( + element_id: ElementId, cut_plane_normal_vector: point_3d, distance_from_global_origin: float +) -> bool: """Slice an element with a plane. Parameters: @@ -748,9 +801,9 @@ def slice_element_with_plane(element_id: ElementId, cut_plane_normal_vector: poi >>> panel_width = 1200. >>> panel_thickness = 20. >>> panel_length = 2400. - >>> panel_id = ec.create_rectangular_panel_vectors(panel_width, panel_thickness, panel_length, + >>> panel_id = ec.create_rectangular_panel_vectors(panel_width, panel_thickness, panel_length, ... cadwork.point_3d(0., 0., 0.), - ... cadwork.point_3d(1., 0., 0.), + ... cadwork.point_3d(1., 0., 0.), ... cadwork.point_3d(0., 0., 1.)) >>> # Define plane normal vector (45° in XY plane) >>> angle_rad = math.radians(45) @@ -771,7 +824,9 @@ def slice_element_with_plane(element_id: ElementId, cut_plane_normal_vector: poi True if the slicing operation was successful, false otherwise. """ -def create_auto_container_from_standard(element_id_list: list[ElementId], output_name: str, standard_element_name: str) -> ElementId: +def create_auto_container_from_standard( + element_id_list: list[ElementId], output_name: str, standard_element_name: str +) -> ElementId: """Create an auto container from a standard element. Parameters: @@ -783,7 +838,9 @@ def create_auto_container_from_standard(element_id_list: list[ElementId], output The id of the created auto container element. """ -def create_auto_export_solid_from_standard_with_reference(element_id_list: list[ElementId], output_name: str, standard_element_name: str, reference_id: ElementId) -> ElementId: +def create_auto_export_solid_from_standard_with_reference( + element_id_list: list[ElementId], output_name: str, standard_element_name: str, reference_id: ElementId +) -> ElementId: """Creates an auto export solid from a standard element with a reference. Parameters: @@ -796,7 +853,9 @@ def create_auto_export_solid_from_standard_with_reference(element_id_list: list[ The id of the created auto export solid element. """ -def create_auto_container_from_standard_with_reference(element_id_list: list[ElementId], output_name: str, standard_element_name: str, reference_id: ElementId) -> ElementId: +def create_auto_container_from_standard_with_reference( + element_id_list: list[ElementId], output_name: str, standard_element_name: str, reference_id: ElementId +) -> ElementId: """Creates an auto container from a standard element with a reference. Parameters: @@ -809,7 +868,6 @@ def create_auto_container_from_standard_with_reference(element_id_list: list[Ele The ID of the created auto container element. """ - def create_surface(surface_vertices: vertex_list) -> ElementId: """Creates a surface from a list of vertices. @@ -897,7 +955,9 @@ def reset_element_cadwork_guid(element_id: ElementId) -> None: element_id: The element id. """ -def create_standard_beam_points(standard_element_name: str, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_standard_beam_points( + standard_element_name: str, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a standard beam using points. Parameters: @@ -921,7 +981,13 @@ def create_standard_beam_points(standard_element_name: str, first_point: point_3 The ID of the created standard beam. """ -def create_standard_beam_vectors(standard_element_name: str, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_standard_beam_vectors( + standard_element_name: str, + length: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a standard beam using vectors. Parameters: @@ -943,7 +1009,9 @@ def create_standard_beam_vectors(standard_element_name: str, length: float, star The ID of the created standard beam. """ -def create_standard_panel_points(standard_element_name: str, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_standard_panel_points( + standard_element_name: str, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a standard panel using points. Parameters: @@ -965,7 +1033,13 @@ def create_standard_panel_points(standard_element_name: str, first_point: point_ The id of the created standard panel. """ -def create_standard_panel_vectors(standard_element_name: str, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_standard_panel_vectors( + standard_element_name: str, + length: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a standard panel using vectors. Parameters: @@ -987,7 +1061,9 @@ def create_standard_panel_vectors(standard_element_name: str, length: float, sta The id of the created standard panel. """ -def create_standard_steel_points(standard_element_name: str, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_standard_steel_points( + standard_element_name: str, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a standard steel element using points. Parameters: @@ -1011,7 +1087,13 @@ def create_standard_steel_points(standard_element_name: str, first_point: point_ The id of the created standard steel element. """ -def create_standard_steel_vectors(standard_element_name: str, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_standard_steel_vectors( + standard_element_name: str, + length: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a standard steel element using vectors. Parameters: @@ -1128,7 +1210,7 @@ def create_bounding_box_local(reference_element: ElementId, element_id_list: lis Parameters: reference_element: The ID of the reference element. - element_id_list: The list of elements for which to create the bounding box. + element_id_list: The list of elements for which to create the bounding box. Returns: The ID of the created bounding box element. @@ -1165,7 +1247,9 @@ def auto_set_rough_volume_situation(element_id_list: list[ElementId]) -> None: element_id_list: The list of elements to process. """ -def rough_volume_situation_manual(cover: ElementId, add_partner: list[ElementId], remove_partner: list[ElementId]) -> None: +def rough_volume_situation_manual( + cover: ElementId, add_partner: list[ElementId], remove_partner: list[ElementId] +) -> None: """Manually sets the rough volume situation for a cover element. Parameters: @@ -1212,7 +1296,9 @@ def add_elements_to_detail(element_id_list: list[ElementId], detail: int) -> Non detail: The ID of the detail. """ -def subtract_elements_with_undo(hard_element_id_list: list[ElementId], soft_element_id_list: list[ElementId], with_undo: bool) -> list[ElementId]: +def subtract_elements_with_undo( + hard_element_id_list: list[ElementId], soft_element_id_list: list[ElementId], with_undo: bool +) -> list[ElementId]: """Subtracts the volume of `hard_elements` from `soft_elements` (boolean difference) with undo functionality. Soft elements are cut in place and keep their IDs. @@ -1228,7 +1314,15 @@ def subtract_elements_with_undo(hard_element_id_list: list[ElementId], soft_elem subtraction. Does not include the IDs from `soft_elements`. """ -def create_linear_optimization(element_id_list: list[ElementId], optimization_number: int, total_length: float, start_cut: float, end_cut: float, saw_kerf: float, is_production_list: bool) -> ElementId: +def create_linear_optimization( + element_id_list: list[ElementId], + optimization_number: int, + total_length: float, + start_cut: float, + end_cut: float, + saw_kerf: float, + is_production_list: bool, +) -> ElementId: """create linear optimization Parameters: @@ -1251,7 +1345,9 @@ def start_element_module_calculation_silently(covers: list[ElementId]) -> None: covers: The list of covers for which to start the element module calculation. """ -def replace_physical_drillings_with_drilling_axes(element_id_list: list[ElementId], mininum_diameter: float, maximum_diameter: float) -> list[ElementId]: +def replace_physical_drillings_with_drilling_axes( + element_id_list: list[ElementId], mininum_diameter: float, maximum_diameter: float +) -> list[ElementId]: """Replaces physical drillings with drilling axes based on diameter range. Parameters: @@ -1304,7 +1400,9 @@ def create_circular_axis_points(diameter: float, first_point: point_3d, second_p The ID of the created circular axis element. """ -def create_circular_axis_vector(diameter: float, length: float, starting_point: point_3d, axis_direction: point_3d) -> ElementId: +def create_circular_axis_vector( + diameter: float, length: float, starting_point: point_3d, axis_direction: point_3d +) -> ElementId: """Creates a circular axis using a vector. Parameters: @@ -1324,8 +1422,9 @@ def create_circular_axis_vector(diameter: float, length: float, starting_point: The ID of the created circular axis element. """ - -def create_polygon_panel(polygon_vertices: vertex_list, thickness: float, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_polygon_panel( + polygon_vertices: vertex_list, thickness: float, x_local_direction: point_3d, z_local_direction: point_3d +) -> ElementId: """Creates a polygon panel. Parameters: @@ -1353,8 +1452,13 @@ def create_polygon_panel(polygon_vertices: vertex_list, thickness: float, x_loca The ID of the created polygon panel element. """ - -def create_polygon_panel_vectors(polygon_vertices: list[point_2d | tuple[float, float]], thickness: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_polygon_panel_vectors( + polygon_vertices: list[point_2d | tuple[float, float]], + thickness: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a polygon panel from a 2D profile using vectors. The profile is defined in the local uv-plane of the panel and extruded from @@ -1419,7 +1523,9 @@ def get_facets_with_lasso(element_id_list: list[ElementId]) -> facet_list: The list of facets selected. """ -def create_standard_element_from_guid_points(guid: str, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_standard_element_from_guid_points( + guid: str, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a standard element from GUID points. Parameters: @@ -1432,7 +1538,9 @@ def create_standard_element_from_guid_points(guid: str, first_point: point_3d, s The id of the created standard element. """ -def create_standard_element_from_guid_vectors(guid: str, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_standard_element_from_guid_vectors( + guid: str, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d +) -> ElementId: """Creates a standard element from GUID vectors. Parameters: @@ -1493,7 +1601,16 @@ def convert_surfaces_to_volume(element_id_list: list[ElementId]) -> ElementId: The ID of the created volume element. """ -def cut_corner_lap(element_id_list: list[ElementId], depth: float, clearance_base: float, clearance_side: float, backcut: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_corner_lap( + element_id_list: list[ElementId], + depth: float, + clearance_base: float, + clearance_side: float, + backcut: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cuts a corner-lap joint with specific parameters. Parameters: @@ -1507,7 +1624,16 @@ def cut_corner_lap(element_id_list: list[ElementId], depth: float, clearance_bas drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def cut_t_lap(element_id_list: list[ElementId], depth: float, clearance_base: float, clearance_side: float, backcut: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_t_lap( + element_id_list: list[ElementId], + depth: float, + clearance_base: float, + clearance_side: float, + backcut: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cuts a T-lap joint with specific parameters. Parameters: @@ -1521,7 +1647,15 @@ def cut_t_lap(element_id_list: list[ElementId], depth: float, clearance_base: fl drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def cut_cross_lap(element_id_list: list[ElementId], depth: float, clearance_base: float, clearance_side: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_cross_lap( + element_id_list: list[ElementId], + depth: float, + clearance_base: float, + clearance_side: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cuts a cross-lap joint with specific parameters. Parameters: @@ -1534,7 +1668,9 @@ def cut_cross_lap(element_id_list: list[ElementId], depth: float, clearance_base drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def delete_processes_keep_cutting_bodies(element_id_list: list[ElementId], keep_cutting_elements_only: bool) -> list[ElementId]: +def delete_processes_keep_cutting_bodies( + element_id_list: list[ElementId], keep_cutting_elements_only: bool +) -> list[ElementId]: """Gets the cutting bodies of all processes (and deletes processes), like Ctrl+D Action Parameters: @@ -1545,7 +1681,16 @@ def delete_processes_keep_cutting_bodies(element_id_list: list[ElementId], keep_ The id list of all removed geometry, cuttings bodies. """ -def cut_double_tenon(element_id_list: list[ElementId], depth1: float, depth2: float, clearance: float, backcut: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_double_tenon( + element_id_list: list[ElementId], + depth1: float, + depth2: float, + clearance: float, + backcut: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cut a double tenon joint with specific parameters. Parameters: @@ -1559,7 +1704,9 @@ def cut_double_tenon(element_id_list: list[ElementId], depth1: float, depth2: fl drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def get_coordinate_system_data_nesting_child(nesting_parent_id: ElementId, nesting_child_id: ElementId) -> coordinate_system_data: +def get_coordinate_system_data_nesting_child( + nesting_parent_id: ElementId, nesting_child_id: ElementId +) -> coordinate_system_data: """Get the coordinate system of nesting child Parameters: @@ -1570,7 +1717,15 @@ def get_coordinate_system_data_nesting_child(nesting_parent_id: ElementId, nesti A global element coordinate-system of the nested child element consisting of a Point1, a Point2 and a Point3. You can get the local placement by subtracting the parent coordinate - system with child coordinate - system. """ -def cut_half_lap(element_id_list: list[ElementId], length: float, clearance_length: float, clearance_depth: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_half_lap( + element_id_list: list[ElementId], + length: float, + clearance_length: float, + clearance_depth: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cut a half-lap joint with specific parameters. Parameters: @@ -1583,7 +1738,16 @@ def cut_half_lap(element_id_list: list[ElementId], length: float, clearance_leng drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def cut_simple_scarf(element_id_list: list[ElementId], length: float, depth: float, clearance_length: float, clearance_depth: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_simple_scarf( + element_id_list: list[ElementId], + length: float, + depth: float, + clearance_length: float, + clearance_depth: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cut a simple scarf joint with specific parameters. Parameters: @@ -1597,7 +1761,14 @@ def cut_simple_scarf(element_id_list: list[ElementId], length: float, depth: flo drilling_tolerance: The tolerance applied to the hole size, typically for fitting the bolt head or allowing easier assembly. """ -def cut_diagonal_cut(element_id_list: list[ElementId], length: float, clearance_length: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_diagonal_cut( + element_id_list: list[ElementId], + length: float, + clearance_length: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cut a diagonal cut joint with specific parameters. Parameters: @@ -1922,7 +2093,9 @@ def get_elements_in_contact(element_id: ElementId) -> list[ElementId]: The list of IDs of the elements in contact with the specified element. """ -def create_text_object_with_options(position: point_3d, x_local_direction: point_3d, z_local_direction: point_3d, text_options: text_object_options) -> ElementId: +def create_text_object_with_options( + position: point_3d, x_local_direction: point_3d, z_local_direction: point_3d, text_options: text_object_options +) -> ElementId: """Creates a text object with the specified options. Parameters: @@ -2009,7 +2182,17 @@ def get_user_element_ids_with_count(count: int) -> list[ElementId]: The list of user element IDs. """ -def cut_scarf_straight(element_id_list: list[ElementId], length: float, depth: float, clearance_length: float, clearance_depth: float, clearance_hook: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_scarf_straight( + element_id_list: list[ElementId], + length: float, + depth: float, + clearance_length: float, + clearance_depth: float, + clearance_hook: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cuts a straight scarf joint (lengthwise) with specific parameters. Parameters: @@ -2024,7 +2207,16 @@ def cut_scarf_straight(element_id_list: list[ElementId], length: float, depth: f drilling_tolerance: The tolerance added to the hole size for easier assembly or bolt head fitting. """ -def cut_scarf_diagonal(element_id_list: list[ElementId], length: float, depth: float, clearance_length: float, clearance_depth: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_scarf_diagonal( + element_id_list: list[ElementId], + length: float, + depth: float, + clearance_length: float, + clearance_depth: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cuts a diagonal scarf joint (lengthwise) with specific parameters. Parameters: @@ -2038,7 +2230,17 @@ def cut_scarf_diagonal(element_id_list: list[ElementId], length: float, depth: f drilling_tolerance: Tolerance added to the hole diameter for ease of insertion or head fit. """ -def cut_scarf_with_wedge(element_id_list: list[ElementId], length: float, depth: float, clearance_length: float, clearance_depth: float, wedge_width: float, drilling_count: UnsignedInt, drilling_diameter: float, drilling_tolerance: float) -> None: +def cut_scarf_with_wedge( + element_id_list: list[ElementId], + length: float, + depth: float, + clearance_length: float, + clearance_depth: float, + wedge_width: float, + drilling_count: UnsignedInt, + drilling_diameter: float, + drilling_tolerance: float, +) -> None: """Cuts a diagonal scarf joint with an added wedge, using specific parameters. Parameters: @@ -2053,7 +2255,9 @@ def cut_scarf_with_wedge(element_id_list: list[ElementId], length: float, depth: drilling_tolerance: Tolerance applied to the hole size, often used for easier bolt fitting or head clearance. """ -def cut_beam_end_profile(element_id_list: list[ElementId], profile_name: str, on_start_face: bool, on_end_face: bool) -> None: +def cut_beam_end_profile( + element_id_list: list[ElementId], profile_name: str, on_start_face: bool, on_end_face: bool +) -> None: """Add end profile to beam elements. Parameters: @@ -2063,7 +2267,9 @@ def cut_beam_end_profile(element_id_list: list[ElementId], profile_name: str, on on_end_face: Cut on the end face? """ -def create_truncated_cone_beam_points(start_diameter: float, end_diameter: float, first_point: point_3d, second_point: point_3d, third_point: point_3d) -> ElementId: +def create_truncated_cone_beam_points( + start_diameter: float, end_diameter: float, first_point: point_3d, second_point: point_3d, third_point: point_3d +) -> ElementId: """Creates a truncated cone beam using points. Parameters: @@ -2089,7 +2295,14 @@ def create_truncated_cone_beam_points(start_diameter: float, end_diameter: float The ID of the created beam. """ -def create_truncated_cone_beam_vectors(start_diameter: float, end_diameter: float, length: float, starting_point: point_3d, x_local_direction: point_3d, z_local_direction: point_3d) -> ElementId: +def create_truncated_cone_beam_vectors( + start_diameter: float, + end_diameter: float, + length: float, + starting_point: point_3d, + x_local_direction: point_3d, + z_local_direction: point_3d, +) -> ElementId: """Creates a truncated cone beam using vectors. Parameters: @@ -2113,7 +2326,6 @@ def create_truncated_cone_beam_vectors(start_diameter: float, end_diameter: floa The ID of the created beam. """ - def create_spline_line(spline_points: vertex_list) -> ElementId: """Creates a spline line. @@ -2154,12 +2366,10 @@ def unjoin_top_level_elements(element_id_list: list[ElementId]) -> bool: """ def set_element_group_single_select_mode() -> None: - """ Switches the current element group selection mode so that single elements of a group are selectable. - """ + """Switches the current element group selection mode so that single elements of a group are selectable.""" def set_element_group_multi_select_mode() -> None: - """Switches the current element group selection mode so that all elements of a group are selected when selecting one of it. - """ + """Switches the current element group selection mode so that all elements of a group are selected when selecting one of it.""" def convert_circular_beam_to_drilling(element_id_list: list[ElementId]) -> None: """Converts circular beams to drillings. @@ -2168,7 +2378,9 @@ def convert_circular_beam_to_drilling(element_id_list: list[ElementId]) -> None: element_id_list: The list of element IDs to convert. """ -def slice_elements_with_plane_and_get_new_elements(element_id: ElementId, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> list[ElementId]: +def slice_elements_with_plane_and_get_new_elements( + element_id: ElementId, cut_plane_normal_vector: point_3d, distance_from_global_origin: float +) -> list[ElementId]: """Slices an element with a plane and returns the new elements. Parameters: @@ -2216,7 +2428,7 @@ def get_elements_in_collision(element_id: ElementId) -> list[ElementId]: A list of IDs of the elements in collision with the specified element. """ -def get_text_object_options(element_id: ElementId) ->'text_object_options': +def get_text_object_options(element_id: ElementId) -> 'text_object_options': """Retrieves the text object options for a specific element e.g. font, text content, etc. Parameters: @@ -2226,21 +2438,20 @@ def get_text_object_options(element_id: ElementId) ->'text_object_options': The text object options for the specified element. """ -def get_is_element_group_single_select_mode() ->bool: +def get_is_element_group_single_select_mode() -> bool: """Gets whether the current element group selection mode is setup to select single elements. Returns: True if the current element group selection mode is set to single select, false otherwise. """ -def get_is_element_group_multi_select_mode() ->bool: +def get_is_element_group_multi_select_mode() -> bool: """Gets whether the current element group selection mode is setup to select multiple elements. Returns: True if the current element group selection mode is set to multi select, false otherwise. """ - def set_shoulder_options(options: shoulder_options) -> None: """Sets the shoulder cut options. @@ -2248,7 +2459,6 @@ def set_shoulder_options(options: shoulder_options) -> None: options: The shoulder options to set. """ - def set_heel_shoulder_options(options: heel_shoulder_options) -> None: """Sets the heel shoulder cut options. @@ -2256,7 +2466,6 @@ def set_heel_shoulder_options(options: heel_shoulder_options) -> None: options: The heel shoulder options to set. """ - def set_double_shoulder_options(options: double_shoulder_options) -> None: """Sets the double shoulder cut options. @@ -2264,8 +2473,7 @@ def set_double_shoulder_options(options: double_shoulder_options) -> None: options: The double shoulder options to set. """ -def cut_shoulder(element_id_list: list[ElementId], connecting_element_id_list: - list[ElementId]) ->None: +def cut_shoulder(element_id_list: list[ElementId], connecting_element_id_list: list[ElementId]) -> None: """Cuts shoulder with current 3D options. Parameters: @@ -2273,8 +2481,7 @@ def cut_shoulder(element_id_list: list[ElementId], connecting_element_id_list: connecting_element_id_list: The list of elements that intersect or connect with the cut elements, used to determine the cutting geometry. """ -def cut_heel_shoulder(element_id_list: list[ElementId], - connecting_element_id_list: list[ElementId]) ->None: +def cut_heel_shoulder(element_id_list: list[ElementId], connecting_element_id_list: list[ElementId]) -> None: """Cuts heel with current 3D options Parameters: @@ -2282,8 +2489,7 @@ def cut_heel_shoulder(element_id_list: list[ElementId], connecting_element_id_list: The list of elements that intersect or connect with the cut elements, used to determine the cutting geometry. """ -def cut_double_shoulder(element_id_list: list[ElementId], - connecting_element_id_list: list[ElementId]) ->None: +def cut_double_shoulder(element_id_list: list[ElementId], connecting_element_id_list: list[ElementId]) -> None: """Cuts a double shoulder joint using the current 3D cutting options. Parameters: @@ -2291,7 +2497,6 @@ def cut_double_shoulder(element_id_list: list[ElementId], connecting_element_id_list: The list of elements that intersect or connect with the cut elements, used to determine the cutting geometry. """ - def filter_elements(element_id_list: list[ElementId], element_filter: element_filter) -> list[ElementId]: """Filters a list of elements based on a provided filter. @@ -2311,7 +2516,6 @@ def filter_elements(element_id_list: list[ElementId], element_filter: element_fi The filtered list of element IDs. """ - def map_elements(element_id_list: list[ElementId], map_query: element_map_query) -> dict[str, list[ElementId]]: """Maps a list of elements based on a provided map query. @@ -2331,9 +2535,9 @@ def map_elements(element_id_list: list[ElementId], map_query: element_map_query) The map of elements that pass the map query. """ - -def cast_ray_and_get_element_intersections(element_id_list: list[ElementId], ray_start_position: point_3d, - ray_end_position: point_3d, radius: float) -> hit_result: +def cast_ray_and_get_element_intersections( + element_id_list: list[ElementId], ray_start_position: point_3d, ray_end_position: point_3d, radius: float +) -> hit_result: """Casts a ray through the 3D model and calculates all intersection points between the ray and specified elements. This function performs ray casting against each specified element to find intersection points.For each element hit by the ray, it returns the element ID and all points where the ray intersects with that element. The ray is defined by a start point, end point, and radius. Parameters: @@ -2358,7 +2562,6 @@ def cast_ray_and_get_element_intersections(element_id_list: list[ElementId], ray Contains list of elements that were hit by the ray and list of vertices that are queried via ElementID. """ - def get_element_active_point(element_id: ElementId) -> active_point_result: """Gets the active point associated with an element. @@ -2386,7 +2589,6 @@ def get_standard_beam_guid_list() -> list[str]: The list of GUIDs of standard beams. """ - def get_standard_panel_guid_list() -> list[str]: """Retrieves a list of standard panel GUIDs. @@ -2394,7 +2596,6 @@ def get_standard_panel_guid_list() -> list[str]: The list of GUIDs of standard panels. """ - def import_standard_beam_from_file(file_path: str) -> None: """Imports a standard beam from a file. @@ -2402,7 +2603,6 @@ def import_standard_beam_from_file(file_path: str) -> None: file_path: The path to the file to be imported. """ - def import_standard_panel_from_file(file_path: str) -> None: """Imports a standard panel from a file. @@ -2410,7 +2610,6 @@ def import_standard_panel_from_file(file_path: str) -> None: file_path: The path to the file to be imported. """ - def export_as_standard_element(element_id: ElementId, name: str) -> str: """Exports an existing element as a standard element. @@ -2425,8 +2624,9 @@ def export_as_standard_element(element_id: ElementId, name: str) -> str: The GUID of the new standard element on success, an empty string on error. """ - -def create_rotation_element(surface_element_id: ElementId, axis_point: point_3d, axis_direction: point_3d, angle_rad: float, segmentation: int) -> ElementId: +def create_rotation_element( + surface_element_id: ElementId, axis_point: point_3d, axis_direction: point_3d, angle_rad: float, segmentation: int +) -> ElementId: """Creates a rotation element from a surface element by rotating it around an axis. Parameters: @@ -2459,7 +2659,9 @@ def create_rotation_element(surface_element_id: ElementId, axis_point: point_3d, The ID of the created rotation element. """ -def apply_image_to_surface(element: ElementId, image_file_path: str, alignment_start: point_3d, alignment_end: point_3d) -> bool: +def apply_image_to_surface( + element: ElementId, image_file_path: str, alignment_start: point_3d, alignment_end: point_3d +) -> bool: """Applies an image texture to a specified surface element. This function allows you to set an image as a texture on a given surface element. The image is mapped to the surface between two specified points that define the alignment and scaling. Parameters: diff --git a/src/endtype_controller/__init__.pyi b/src/endtype_controller/__init__.pyi index 979e73b..5ba9677 100644 --- a/src/endtype_controller/__init__.pyi +++ b/src/endtype_controller/__init__.pyi @@ -64,7 +64,6 @@ def get_endtype_id_end(element_id: ElementId) -> EndtypeId: The wanted endtype element id. """ - def get_endtype_id_facet(element_id: ElementId, face_number: int) -> EndtypeId: """Gets the endtype id of a face with the face number. @@ -124,7 +123,6 @@ def set_endtype_name_end(element_id: ElementId, name: str) -> None: >>> etc.set_endtype_name_end(element, endtype_name) """ - def set_endtype_name_facet(element_id: ElementId, name: str, face_number: int) -> None: """Sets the endtype to a face by endtype name. @@ -182,7 +180,6 @@ def set_endtype_id_end(element_id: ElementId, endtype_id: EndtypeId) -> None: >>> etc.set_endtype_id_end(element, endtype_id) """ - def set_endtype_id_facet(element_id: ElementId, endtype_id: EndtypeId, face_number: int) -> None: """Sets the endtype to a face by endtype id. diff --git a/src/file_controller/__init__.pyi b/src/file_controller/__init__.pyi index 423a4d5..5e9f050 100644 --- a/src/file_controller/__init__.pyi +++ b/src/file_controller/__init__.pyi @@ -31,7 +31,6 @@ def export_stl_file(element_id_list: list[ElementId], file_path: str) -> None: >>> fc.export_stl_file(selected_elements, output_path) """ - def import_step_file(file_path: str, scale_factor: float) -> list[ElementId]: """Imports a STEP file. @@ -43,7 +42,6 @@ def import_step_file(file_path: str, scale_factor: float) -> list[ElementId]: The imported list of element id. """ - def import_step_file_with_message_option(file_path: str, scale_factor: float, hide_message: bool) -> list[ElementId]: """Imports a STEP file with message option. @@ -56,7 +54,6 @@ def import_step_file_with_message_option(file_path: str, scale_factor: float, hi The imported list of element id. """ - def export_webgl(element_id_list: list[ElementId], file_path: str) -> bool: """Exports a WebGL file. @@ -78,7 +75,6 @@ def export_webgl(element_id_list: list[ElementId], file_path: str) -> bool: True on successful export, false otherwise. """ - def export_3d_file(element_id_list: list[ElementId], file_path: str) -> bool: """Exports a 3D file. @@ -100,7 +96,6 @@ def export_3d_file(element_id_list: list[ElementId], file_path: str) -> bool: True on successful export, false otherwise. """ - def import_sat_file(file_path: str, scale_factor: float, binary: bool) -> list[ElementId]: """Imports an SAT file. @@ -113,7 +108,6 @@ def import_sat_file(file_path: str, scale_factor: float, binary: bool) -> list[E The imported list of element id. """ - def import_3dc_file(file_path: str) -> list[ElementId]: """Imports a 3DC file. @@ -124,7 +118,6 @@ def import_3dc_file(file_path: str) -> list[ElementId]: The imported list of element id. """ - def import_rhino_file(file_path: str, without_dialog: bool) -> list[ElementId]: """Imports a Rhino file. @@ -136,9 +129,9 @@ def import_rhino_file(file_path: str, without_dialog: bool) -> list[ElementId]: The imported list of element id. """ - -def export_step_file(element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, - text_mode: bool) -> None: +def export_step_file( + element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, text_mode: bool +) -> None: """Exports a STEP file. Parameters: @@ -162,7 +155,6 @@ def export_step_file(element_id_list: list[ElementId], file_path: str, scale_fac >>> fc.export_step_file(selected_elements, output_path, scale_factor, version, text_mode) """ - def import_3dz_file(file_path: str) -> None: """Imports a 3DZ file. @@ -170,7 +162,6 @@ def import_3dz_file(file_path: str) -> None: file_path: The input file path. """ - def export_obj_file(element_id_list: list[ElementId], file_path: str) -> None: """Exports a OBJ file. @@ -187,7 +178,6 @@ def export_obj_file(element_id_list: list[ElementId], file_path: str) -> None: >>> fc.export_obj_file(selected_elements, output_path) """ - def import_sat_file_silently(file_path: str, scale_factor: float, binary: bool) -> list[ElementId]: """Imports a SAT File without messages. @@ -200,18 +190,17 @@ def import_sat_file_silently(file_path: str, scale_factor: float, binary: bool) The imported list of element id. """ - def export_fbx_file(element_id_list: list[ElementId], file_path: str, fbx_format: int) -> None: """Exports a FBX file. Parameters: element_id_list: The list of element id to export. file_path: The output file path. - fbx_format: The FBX format. - + fbx_format: The FBX format. + Available values : - - + + - 1 = "FBX binary(*.fbx)"; - 2 = "FBX ascii(*.fbx)"; - 3 = "FBX encrypted(*.fbx)"; @@ -233,11 +222,8 @@ def export_fbx_file(element_id_list: list[ElementId], file_path: str, fbx_format >>> fc.export_fbx_file(selected_elements, output_path, fbx_format) """ - def clear_errors() -> None: - """Clears all errors. - """ - + """Clears all errors.""" def import_3dc_file_with_glide(file_path: str) -> list[ElementId]: """Imports a 3DC file with glide. @@ -249,7 +235,6 @@ def import_3dc_file_with_glide(file_path: str) -> list[ElementId]: The imported list of element id. """ - def import_btl_file(file_path: str) -> None: """Imports a BTL file. @@ -257,7 +242,6 @@ def import_btl_file(file_path: str) -> None: file_path: The input file path. """ - def export_3dc_file(element_id_list: list[ElementId], file_path: str) -> None: """Exports a 3D file. @@ -274,7 +258,6 @@ def export_3dc_file(element_id_list: list[ElementId], file_path: str) -> None: >>> fc.export_3dc_file(selected_elements, output_path) """ - def import_btl_file_for_nesting(file_path: str) -> None: """Imports a BTL file for nesting. @@ -282,7 +265,6 @@ def import_btl_file_for_nesting(file_path: str) -> None: file_path: The input file path. """ - def export_btl_file_for_nesting(file_path: str) -> None: """Exports a BTL file for nesting. @@ -296,9 +278,13 @@ def export_btl_file_for_nesting(file_path: str) -> None: >>> fc.export_btl_file_for_nesting(output_path) """ - -def export_rhino_file(element_id_list: list[ElementId], file_path: str, version: int, use_default_assignment: bool, - write_standard_attributes: bool) -> None: +def export_rhino_file( + element_id_list: list[ElementId], + file_path: str, + version: int, + use_default_assignment: bool, + write_standard_attributes: bool, +) -> None: """Exports a 3dm rhino file. Parameters: @@ -326,7 +312,6 @@ def export_rhino_file(element_id_list: list[ElementId], file_path: str, version: >>> fc.export_rhino_file(selected_elements, output_path, version, use_default_assignment, write_standard_attributes) """ - def import_bxf_file(file_path: str, insert_position: point_3d) -> list[ElementId]: """Imports a BXF file. @@ -338,7 +323,6 @@ def import_bxf_file(file_path: str, insert_position: point_3d) -> list[ElementId The list of IDs of the imported elements. """ - def get_blum_export_path() -> str: """Gets the path of the Blum export. @@ -346,7 +330,6 @@ def get_blum_export_path() -> str: The path of the Blum export. """ - def set_blum_export_path(path: str) -> None: """Sets the path of the Blum export. @@ -354,8 +337,9 @@ def set_blum_export_path(path: str) -> None: path: The new path for the Blum export. """ - -def export_sat_file(element_id_list: list[ElementId], file_path: str, scale_factor: float, binary: bool, version: int) -> None: +def export_sat_file( + element_id_list: list[ElementId], file_path: str, scale_factor: float, binary: bool, version: int +) -> None: """Exports a SAT File. Parameters: @@ -382,7 +366,6 @@ def export_sat_file(element_id_list: list[ElementId], file_path: str, scale_fact >>> fc.export_sat_file(selected_elements, output_path, scale_factor, binary_format, version) """ - def export_glb_file(element_id_list: list[ElementId], file_path: str) -> None: """Exports a GLB File. @@ -399,7 +382,6 @@ def export_glb_file(element_id_list: list[ElementId], file_path: str) -> None: >>> fc.export_glb_file(selected_elements, output_path) """ - def import_variant_file(file_path: str, insert_position: point_3d) -> list[ElementId]: """Imports a variant (.val-File). @@ -411,7 +393,6 @@ def import_variant_file(file_path: str, insert_position: point_3d) -> list[Eleme The imported list of element id. """ - def import_element_light(file_path: str, insert_position: point_3d) -> int: """Imports a light element from a file. @@ -423,10 +404,14 @@ def import_element_light(file_path: str, insert_position: point_3d) -> int: The ID of the imported light element. """ - -def export_rhino_file_with_options(element_id_list: list[ElementId], file_path: str, version: int, - use_default_assignment: bool, write_standard_attributes: bool, - rhino_options: None) -> None: +def export_rhino_file_with_options( + element_id_list: list[ElementId], + file_path: str, + version: int, + use_default_assignment: bool, + write_standard_attributes: bool, + rhino_options: None, +) -> None: """Exports elements to a rhino 3dm file based on the export options. Parameters: @@ -456,7 +441,6 @@ def export_rhino_file_with_options(element_id_list: list[ElementId], file_path: >>> fc.export_rhino_file_with_options(selected_elements, output_path, version, use_default_assignment, write_standard_attributes, rhino_options) """ - def import_3dc_file_with_options(file_path: str, import_3dc_options: import_3dc_options) -> list[ElementId]: """Imports a 3d or a 3dc file depending on the import options. @@ -468,7 +452,6 @@ def import_3dc_file_with_options(file_path: str, import_3dc_options: import_3dc_ The imported list of element id. """ - def get_import_3dc_options() -> import_3dc_options: """Get the 3dc import options. @@ -476,7 +459,6 @@ def get_import_3dc_options() -> import_3dc_options: The 3dc import options. """ - def load_webgl_preset_file(file_path: str) -> None: """Loads a preset file for the WebGl export. @@ -484,9 +466,14 @@ def load_webgl_preset_file(file_path: str) -> None: file_path: The preset file path. """ - -def export_step_file_extrude_drillings(element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, - text_mode: bool, imperial_units: bool) -> None: +def export_step_file_extrude_drillings( + element_id_list: list[ElementId], + file_path: str, + scale_factor: float, + version: int, + text_mode: bool, + imperial_units: bool, +) -> None: """Exports a STEP file with extruded drillings. Parameters: @@ -512,9 +499,14 @@ def export_step_file_extrude_drillings(element_id_list: list[ElementId], file_pa >>> fc.export_step_file_extrude_drillings(selected_elements, output_path, scale_factor, version, text_mode, imperial_units) """ - -def export_step_file_cut_drillings(element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, - text_mode: bool, imperial_units: bool) -> None: +def export_step_file_cut_drillings( + element_id_list: list[ElementId], + file_path: str, + scale_factor: float, + version: int, + text_mode: bool, + imperial_units: bool, +) -> None: """Exports a STEP file with extruded drillings. Parameters: @@ -540,9 +532,9 @@ def export_step_file_cut_drillings(element_id_list: list[ElementId], file_path: >>> fc.export_step_file_cut_drillings(selected_elements, output_path, scale_factor, version, text_mode, imperial_units) """ - -def export_sat_file_cut_drillings(element_id_list: list[ElementId], file_path: str, - scale_factor: float, binary: bool, version: int) -> None: +def export_sat_file_cut_drillings( + element_id_list: list[ElementId], file_path: str, scale_factor: float, binary: bool, version: int +) -> None: """Exports a SAT File with extruded drillings (cut drilling holes into bodies). Parameters: @@ -558,7 +550,6 @@ def export_sat_file_cut_drillings(element_id_list: list[ElementId], file_path: s - 2100 = v21.0 """ - def upload_to_bim_team_and_create_share_link(element_id_list: list[ElementId]) -> bim_team_upload_result: """Exports the elements to BIMteam and creates a share link. @@ -569,9 +560,9 @@ def upload_to_bim_team_and_create_share_link(element_id_list: list[ElementId]) - The result object with a result code and a share link. If the code is not ok (0), the share link string is empty. """ - -def export_dxf_file(file_path: str, dxf_layer_format_type: dxf_layer_format_type, - dxf_export_version: dxf_export_version) -> bool: +def export_dxf_file( + file_path: str, dxf_layer_format_type: dxf_layer_format_type, dxf_export_version: dxf_export_version +) -> bool: """Exports visible elements in the scene to a DXF file. Parameters: @@ -583,7 +574,6 @@ def export_dxf_file(file_path: str, dxf_layer_format_type: dxf_layer_format_type True on successful export, false otherwise. """ - def export_dstv_file(file_path: str) -> bool: """Exports active elements in the scene to a DSTV (.stp) file. @@ -594,7 +584,6 @@ def export_dstv_file(file_path: str) -> bool: True on successful export, false otherwise. """ - def set_webgl_hierarchy(stage: int, attribute: display_attribute) -> None: """Sets the WebGL hierarchy based on the given stage and attribute. @@ -603,8 +592,9 @@ def set_webgl_hierarchy(stage: int, attribute: display_attribute) -> None: attribute: The display attribute to use for the hierarchy. """ - -def export_step_file_ex(element_list: list[ElementId], file_path: str, scale_factor: float, substract_drillings: bool) -> None: +def export_step_file_ex( + element_list: list[ElementId], file_path: str, scale_factor: float, substract_drillings: bool +) -> None: """Exports a STEP file with new algorithm. Parameters: diff --git a/src/geometry_controller/__init__.pyi b/src/geometry_controller/__init__.pyi index 9efd7de..39aab80 100644 --- a/src/geometry_controller/__init__.pyi +++ b/src/geometry_controller/__init__.pyi @@ -13,7 +13,6 @@ from cadwork.facet_list import facet_list from cadwork.point_3d import point_3d from cadwork.division_zone_direction import division_zone_direction - def rotate_height_axis_90(element_id_list: list[ElementId]) -> None: """Rotates the element height axis 90 degrees. @@ -195,8 +194,7 @@ def rotate_height_axis_2_points(element_id_list: list[ElementId], point1: point_ """ def clear_errors() -> None: - """Clears all errors. - """ + """Clears all errors.""" def set_drilling_tolerance(element_id_list: list[ElementId], tolerance: float) -> None: """Sets the drilling tolerance of the axis. diff --git a/src/list_controller/__init__.pyi b/src/list_controller/__init__.pyi index c23c01a..40a0059 100644 --- a/src/list_controller/__init__.pyi +++ b/src/list_controller/__init__.pyi @@ -40,10 +40,11 @@ def check_position_numbers_part_list() -> list[ElementId]: """ def clear_errors() -> None: - """Clears all errors. - """ + """Clears all errors.""" -def export_production_list_with_settings(element_id_list: list[ElementId], file_path: str, settings_file_path: str) -> None: +def export_production_list_with_settings( + element_id_list: list[ElementId], file_path: str, settings_file_path: str +) -> None: """Exports a production list using an additional settings file. Parameters: @@ -89,8 +90,9 @@ def load_part_list_calculation_settings(settings_file_path: str) -> None: settings_file_path: The path to the settings file to be loaded. """ -def generate_new_production_list_silently(element_id_list: list[ElementId], starting_number: UnsignedInt, keep_existing_numbers: bool, - with_containers: bool) -> None: +def generate_new_production_list_silently( + element_id_list: list[ElementId], starting_number: UnsignedInt, keep_existing_numbers: bool, with_containers: bool +) -> None: """Generates new production list numbers silently starting from a given number, optionally keeping existing numbers and considering container elements. Parameters: @@ -100,8 +102,9 @@ def generate_new_production_list_silently(element_id_list: list[ElementId], star with_containers: Whether to include container elements in the number generation. """ -def generate_new_part_list_silently(element_id_list: list[ElementId], starting_number: UnsignedInt, keep_existing_numbers: bool, - with_containers: bool) -> None: +def generate_new_part_list_silently( + element_id_list: list[ElementId], starting_number: UnsignedInt, keep_existing_numbers: bool, with_containers: bool +) -> None: """Generates new part list numbers silently starting from a given number, optionally keeping existing numbers and considering container elements. Parameters: diff --git a/src/machine_controller/__init__.pyi b/src/machine_controller/__init__.pyi index af9d741..840a869 100644 --- a/src/machine_controller/__init__.pyi +++ b/src/machine_controller/__init__.pyi @@ -16,7 +16,6 @@ from cadwork.panel_prefab_element_settings import panel_prefab_element_settings from cadwork.weinmann_mfb_version import weinmann_mfb_version from cadwork.btl_version import btl_version - def export_btl(btl_version: btl_version, file_path: str) -> None: """Exports a BTL file. @@ -76,7 +75,9 @@ def export_hundegger_with_file_path(hundeggertype: hundegger_machine_type, file_ >>> mc.export_hundegger_with_file_path(hundegger_type, output_path) """ -def export_hundegger_with_file_path_and_presetting(hundeggertype: hundegger_machine_type, file_path: str, presetting: str) -> None: +def export_hundegger_with_file_path_and_presetting( + hundeggertype: hundegger_machine_type, file_path: str, presetting: str +) -> None: """Exports a Hundegger file. Parameters: @@ -170,7 +171,9 @@ def export_hundegger_with_file_path_silent(hundeggertype: hundegger_machine_type >>> mc.export_hundegger_with_file_path_silent(hundegger_type, output_path) """ -def export_hundegger_with_file_path_and_presetting_silent(hundeggertype: hundegger_machine_type, file_path: str, presetting: str) -> None: +def export_hundegger_with_file_path_and_presetting_silent( + hundeggertype: hundegger_machine_type, file_path: str, presetting: str +) -> None: """Exports a Hundegger file silently. Parameters: @@ -188,7 +191,6 @@ def export_hundegger_with_file_path_and_presetting_silent(hundeggertype: hundegg >>> mc.export_hundegger_with_file_path_and_presetting_silent(hundegger_type, output_path, presetting_file) """ - def get_element_hundegger_processings(element_id: ElementId, hundeggertype: hundegger_machine_type) -> list[ElementId]: """Gets the list of Hundegger processings for a specific element. @@ -210,7 +212,6 @@ def get_element_hundegger_processings(element_id: ElementId, hundeggertype: hund A list of element IDs representing the processings. """ - def get_element_btl_processings(element_id: ElementId, btl_version: btl_version) -> list[ElementId]: """Gets the list of BTL processings for a specific element. @@ -232,7 +233,6 @@ def get_element_btl_processings(element_id: ElementId, btl_version: btl_version) A list of element IDs representing the processings. """ - def get_processing_name(reference_element_id: ElementId, processing_id: ElementId) -> str: """Gets the name of a specific processing. @@ -254,7 +254,6 @@ def get_processing_name(reference_element_id: ElementId, processing_id: ElementI The name of the processing. """ - def get_processing_code(reference_element_id: ElementId, processing_id: ElementId) -> str: """Gets the code of a specific processing. @@ -276,7 +275,6 @@ def get_processing_code(reference_element_id: ElementId, processing_id: ElementI The code of the processing. """ - def get_processing_points(reference_element_id: ElementId, processing_id: ElementId) -> vertex_list: """Gets the points of a specific processing. @@ -298,7 +296,6 @@ def get_processing_points(reference_element_id: ElementId, processing_id: Elemen A list of vertices representing the points of the processing. """ - def get_processing_btl_parameter_set(reference_element_id: ElementId, processing_id: ElementId) -> list[str]: """Gets the BTL parameter set of a specific processing. @@ -320,7 +317,6 @@ def get_processing_btl_parameter_set(reference_element_id: ElementId, processing A list of strings representing the BTL parameter set of the processing. """ - def get_panel_prefab_element_data(element_id: ElementId) -> panel_prefab_element_data: """Gets the machine panel prefabrication data of an element. @@ -345,7 +341,6 @@ def get_panel_prefab_element_data(element_id: ElementId) -> panel_prefab_element The panel prefab element data. """ - def set_panel_prefab_element_data(element_id_list: list[ElementId], settings: panel_prefab_element_settings) -> None: """Sets the machine panel prefabrication data on a list of elements. @@ -369,8 +364,6 @@ def set_panel_prefab_element_data(element_id_list: list[ElementId], settings: pa >>> settings.set_machine_calculation_set("MyMfbConfig") >>> mc.set_panel_prefab_element_data(elements, settings) """ - - def load_btl_calculation_set(btl_type: btl_version, file_path: str) -> None: """Loads the BTL calculation set. @@ -378,4 +371,4 @@ def load_btl_calculation_set(btl_type: btl_version, file_path: str) -> None: Parameters: btl_type: The BTL machine type (cadwork.btl_version). file_path: The file path of the calculation set. - """ \ No newline at end of file + """ diff --git a/src/material_controller/__init__.pyi b/src/material_controller/__init__.pyi index 8b44e77..2aecfcb 100644 --- a/src/material_controller/__init__.pyi +++ b/src/material_controller/__init__.pyi @@ -181,9 +181,7 @@ def set_weight_type(material_id: MaterialId, weight_type: str) -> None: """ def clear_errors() -> None: - """Clears all errors. - """ - + """Clears all errors.""" def set_grade(material_id: MaterialId, grade: str) -> None: """Sets the grade of a material. @@ -193,7 +191,6 @@ def set_grade(material_id: MaterialId, grade: str) -> None: grade: The grade to set. """ - def set_quality(material_id: MaterialId, quality: str) -> None: """Sets the quality of a material. @@ -202,7 +199,6 @@ def set_quality(material_id: MaterialId, quality: str) -> None: quality: The quality to set. """ - def set_composition(material_id: MaterialId, composition: str) -> None: """Sets the composition of a material. @@ -428,7 +424,6 @@ def get_all_materials() -> list[MaterialId]: A list of all material id. """ - def get_grade(material_id: MaterialId) -> str: """Gets the grade of a material. @@ -439,7 +434,6 @@ def get_grade(material_id: MaterialId) -> str: The grade of the material. """ - def get_quality(material_id: MaterialId) -> str: """Gets the quality of a material. @@ -450,7 +444,6 @@ def get_quality(material_id: MaterialId) -> str: The quality of the material. """ - def get_composition(material_id: MaterialId) -> str: """Gets the composition of a material. @@ -461,7 +454,6 @@ def get_composition(material_id: MaterialId) -> str: The composition of the material. """ - def get_short_name(material_id: MaterialId) -> str: """Gets the short name of a material. @@ -489,7 +481,6 @@ def get_parent_group(group: str) -> str: The name of the parent group. """ - def get_material_color_assignment_for_nodes(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for nodes. @@ -500,7 +491,6 @@ def get_material_color_assignment_for_nodes(color_nb: UnsignedInt) -> MaterialId The material id assigned to the color number for nodes. """ - def set_material_color_assignment_for_nodes(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for nodes. @@ -509,7 +499,6 @@ def set_material_color_assignment_for_nodes(color_nb: UnsignedInt, material_id: material_id: The material ID to assign to the color number for nodes. """ - def get_material_color_assignment_for_standard_axes(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for standard axes. @@ -520,7 +509,6 @@ def get_material_color_assignment_for_standard_axes(color_nb: UnsignedInt) -> Ma The material id assigned to the color number for standard axes. """ - def set_material_color_assignment_for_standard_axes(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for standard axes. @@ -529,7 +517,6 @@ def set_material_color_assignment_for_standard_axes(color_nb: UnsignedInt, mater material_id: The material ID to assign to the color number for standard axes. """ - def get_material_color_assignment_for_drillings(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for drillings. @@ -540,7 +527,6 @@ def get_material_color_assignment_for_drillings(color_nb: UnsignedInt) -> Materi The material id assigned to the color number for drillings. """ - def set_material_color_assignment_for_drillings(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for drillings. @@ -549,7 +535,6 @@ def set_material_color_assignment_for_drillings(color_nb: UnsignedInt, material_ material_id: The material ID to assign to the color number for drillings. """ - def get_material_color_assignment_for_mep_axes(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for MEP axes. @@ -560,7 +545,6 @@ def get_material_color_assignment_for_mep_axes(color_nb: UnsignedInt) -> Materia The material id assigned to the color number for MEP axes. """ - def set_material_color_assignment_for_mep_axes(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for MEP axes. @@ -569,7 +553,6 @@ def set_material_color_assignment_for_mep_axes(color_nb: UnsignedInt, material_i material_id: The material ID to assign to the color number for MEP axes. """ - def get_material_color_assignment_for_beams(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for beams. @@ -580,7 +563,6 @@ def get_material_color_assignment_for_beams(color_nb: UnsignedInt) -> MaterialId The material id assigned to the color number for beams. """ - def set_material_color_assignment_for_beams(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for beams. @@ -589,7 +571,6 @@ def set_material_color_assignment_for_beams(color_nb: UnsignedInt, material_id: material_id: The material ID to assign to the color number for beams. """ - def get_material_color_assignment_for_panels(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for panels. @@ -600,7 +581,6 @@ def get_material_color_assignment_for_panels(color_nb: UnsignedInt) -> MaterialI The material id assigned to the color number for panels. """ - def set_material_color_assignment_for_panels(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for panels. @@ -609,7 +589,6 @@ def set_material_color_assignment_for_panels(color_nb: UnsignedInt, material_id: material_id: The material ID to assign to the color number for panels. """ - def get_material_color_assignment_for_auxiliary_elements(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for auxiliary elements. @@ -620,7 +599,6 @@ def get_material_color_assignment_for_auxiliary_elements(color_nb: UnsignedInt) The material id assigned to the color number for auxiliary elements. """ - def set_material_color_assignment_for_auxiliary_elements(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for auxiliary elements. @@ -629,7 +607,6 @@ def set_material_color_assignment_for_auxiliary_elements(color_nb: UnsignedInt, material_id: The material ID to assign to the color number for auxiliary elements. """ - def get_material_color_assignment_for_surfaces(color_nb: UnsignedInt) -> MaterialId: """Gets the material color assignment for surfaces. @@ -640,7 +617,6 @@ def get_material_color_assignment_for_surfaces(color_nb: UnsignedInt) -> Materia The material id assigned to the color number for surfaces. """ - def set_material_color_assignment_for_surfaces(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the material color assignment for surfaces. @@ -649,7 +625,6 @@ def set_material_color_assignment_for_surfaces(color_nb: UnsignedInt, material_i material_id: The material ID to assign to the color number for surfaces. """ - def get_texture_color(material_id: MaterialId) -> int: """Gets the texture color for a given material ID. @@ -660,7 +635,6 @@ def get_texture_color(material_id: MaterialId) -> int: The color of the texture. [1-255] """ - def set_texture_color(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the texture color for a given material ID. @@ -669,7 +643,6 @@ def set_texture_color(color_nb: UnsignedInt, material_id: MaterialId) -> None: material_id: The material id. """ - def get_texture_transparency(material_id: MaterialId) -> int: """Gets the texture transparency for a given material ID. @@ -680,7 +653,6 @@ def get_texture_transparency(material_id: MaterialId) -> int: The transparency of the texture. """ - def set_texture_transparency(color_nb: UnsignedInt, material_id: MaterialId) -> None: """Sets the texture transparency for a given material ID. @@ -689,7 +661,6 @@ def set_texture_transparency(color_nb: UnsignedInt, material_id: MaterialId) -> material_id: The material id. """ - def get_texture_rotation_angle(material_id: MaterialId) -> float: """Gets the texture rotation angle for a given material ID. @@ -700,7 +671,6 @@ def get_texture_rotation_angle(material_id: MaterialId) -> float: The rotation angle of the texture. """ - def set_texture_rotation_angle(material_id: MaterialId, angle: float) -> None: """Sets the texture rotation angle for a given material ID. @@ -709,7 +679,6 @@ def set_texture_rotation_angle(material_id: MaterialId, angle: float) -> None: angle: The rotation angle to set for the texture. """ - def get_texture_length_alignment(material_id: MaterialId) -> bool: """Gets the texture length alignment for a given material ID. @@ -720,7 +689,6 @@ def get_texture_length_alignment(material_id: MaterialId) -> bool: True if Texture Random Placement is enabled, false otherwise. """ - def set_texture_length_alignment(material_id: MaterialId, flag: bool) -> None: """Sets the texture length alignment for a given material ID. @@ -729,7 +697,6 @@ def set_texture_length_alignment(material_id: MaterialId, flag: bool) -> None: flag: True if Texture Random Placement is enabled, false otherwise. """ - def get_texture_zoom_x(material_id: MaterialId) -> float: """Gets the texture zoom factor in the X direction for a given material ID. @@ -740,7 +707,6 @@ def get_texture_zoom_x(material_id: MaterialId) -> float: The zoom factor of the texture in the X direction. """ - def set_texture_zoom_x(material_id: MaterialId, value: float) -> None: """Sets the texture zoom factor in the X direction for a given material ID. @@ -749,7 +715,6 @@ def set_texture_zoom_x(material_id: MaterialId, value: float) -> None: value: The zoom factor to set in the X direction. """ - def get_texture_zoom_y(material_id: MaterialId) -> float: """Gets the texture zoom factor in the Y direction for a given material ID. @@ -760,11 +725,10 @@ def get_texture_zoom_y(material_id: MaterialId) -> float: The zoom factor of the texture in the Y direction. """ - def set_texture_zoom_y(material_id: MaterialId, value: float) -> None: """Sets the texture zoom factor in the Y direction for a given material ID. Parameters: material_id: The material id. value: The zoom factor to set. - """ \ No newline at end of file + """ diff --git a/src/menu_controller/__init__.pyi b/src/menu_controller/__init__.pyi index bd3bc31..969c857 100644 --- a/src/menu_controller/__init__.pyi +++ b/src/menu_controller/__init__.pyi @@ -7,7 +7,6 @@ dialogs when a list-of-options interaction fits better than a modal form. """ - def display_simple_menu(menu_items: list[str]) -> str: """Displays a simple menu. @@ -17,4 +16,3 @@ def display_simple_menu(menu_items: list[str]) -> str: Returns: The selected menu item. """ - diff --git a/src/multi_layer_cover_controller/__init__.pyi b/src/multi_layer_cover_controller/__init__.pyi index d790ef0..7d7d037 100644 --- a/src/multi_layer_cover_controller/__init__.pyi +++ b/src/multi_layer_cover_controller/__init__.pyi @@ -88,7 +88,9 @@ def create_multi_layer_wall(set_name: str) -> MultiLayerSetId: The multi layer set id. """ -def add_layer(set_id: MultiLayerSetId, layer_type: multi_layer_type, name: str, material_id: MaterialId, thickness: float) -> None: +def add_layer( + set_id: MultiLayerSetId, layer_type: multi_layer_type, name: str, material_id: MaterialId, thickness: float +) -> None: """Adds a new layer to the multi layer set. Parameters: @@ -519,7 +521,6 @@ def get_multi_layer_sets_for_cover_type(cover_type: multi_layer_cover_type) -> l The multi layer set ids. """ - def get_multi_layer_log_walls() -> list[MultiLayerSetId]: """Gets all multi layer log wall ids. @@ -682,7 +683,9 @@ def set_layer_standard_beam_guid(set_id: MultiLayerSetId, layer_index: UnsignedI guid: The layer standard beam guid. """ -def add_layer_by_standard_elements(set_id: MultiLayerSetId, type: multi_layer_type, name: str, panel_guid: str, beam_guid: str, thickness: float) -> None: +def add_layer_by_standard_elements( + set_id: MultiLayerSetId, type: multi_layer_type, name: str, panel_guid: str, beam_guid: str, thickness: float +) -> None: """Adds layer by standard element. Parameters: diff --git a/src/roof_controller/__init__.pyi b/src/roof_controller/__init__.pyi index d6eeaf8..a5139fe 100644 --- a/src/roof_controller/__init__.pyi +++ b/src/roof_controller/__init__.pyi @@ -25,9 +25,9 @@ def get_edge_length(element_id: ElementId, edge_type: str) -> float: Parameters: element_id: The element id. - edge_type: The edge type : + edge_type: The edge type : + - - "none" - "ridge" @@ -75,6 +75,4 @@ def get_all_caddy_element_ids() -> list[ElementId]: """ def clear_errors() -> None: - """Clears all errors. - """ - + """Clears all errors.""" diff --git a/src/scene_controller/__init__.pyi b/src/scene_controller/__init__.pyi index 76c188f..8157449 100644 --- a/src/scene_controller/__init__.pyi +++ b/src/scene_controller/__init__.pyi @@ -83,8 +83,7 @@ def activate_scene(name: str) -> bool: """ def clear_errors() -> None: - """Clears all errors. - """ + """Clears all errors.""" def get_scene_list() -> list[str]: """Gets the list of scenes. diff --git a/src/shop_drawing_controller/__init__.pyi b/src/shop_drawing_controller/__init__.pyi index 8fd8638..917b79a 100644 --- a/src/shop_drawing_controller/__init__.pyi +++ b/src/shop_drawing_controller/__init__.pyi @@ -10,7 +10,6 @@ counterpart to file_controller's neutral 3D exports. from cadwork.point_3d import point_3d from cadwork.api_types import * - def export_2d_wireframe_with_clipboard(clipboard_number: UnsignedInt, with_layout: bool) -> None: """Exports a 2D wireframe to the clipboard. @@ -99,7 +98,9 @@ def add_wall_section_vertical(element_id: ElementId, position: point_3d) -> None position: The section position. """ -def export_wall_with_clipboard_and_presetting(clipboard_number: UnsignedInt, element_id_list: list[ElementId], presetting_file: str) -> None: +def export_wall_with_clipboard_and_presetting( + clipboard_number: UnsignedInt, element_id_list: list[ElementId], presetting_file: str +) -> None: """Exports a wall to the clipboard. Parameters: @@ -123,8 +124,7 @@ def save_export_piece_by_piece_settings(settings_file_path: str) -> None: """ def clear_errors() -> None: - """Clears all errors. - """ + """Clears all errors.""" def load_export_wall_settings(settings_file_path: str) -> None: """Loads wall export settings. @@ -145,4 +145,4 @@ def load_export_container_settings(settings_file_path: str) -> None: Parameters: settings_file_path: The settings file path. - """ \ No newline at end of file + """ diff --git a/src/utility_controller/__init__.pyi b/src/utility_controller/__init__.pyi index 7fd2517..b2296fe 100644 --- a/src/utility_controller/__init__.pyi +++ b/src/utility_controller/__init__.pyi @@ -15,7 +15,6 @@ 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: """Gets the 3D version. @@ -45,7 +44,6 @@ def set_project_data(project_data_id: str, data: str) -> None: data: The data to set. """ - def print_error(message: str) -> None: """Prints an error to the bottom toolbar of Cadwork 3d. @@ -57,7 +55,6 @@ def print_error(message: str) -> None: message: The error message. """ - def get_language() -> str: """Gets the 3D language. @@ -65,7 +62,6 @@ def get_language() -> str: The language. """ - def set_language(lang: language) -> None: """Sets the 3D language and refreshes the UI. @@ -78,7 +74,6 @@ def set_language(lang: language) -> None: lang: The language to set. """ - def get_language_enum() -> language: """Gets the 3D language as a typed enum. @@ -86,7 +81,6 @@ def get_language_enum() -> language: 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. @@ -101,7 +95,6 @@ def print_message(message: str, row: int, column: int) -> None: column: The column to print the message in. """ - def get_user_int(message: str) -> int: """Prompts the user for an integer. @@ -112,7 +105,6 @@ def get_user_int(message: str) -> int: The user input integer. """ - def get_user_double(message: str) -> float: """Prompts the user for a double. @@ -123,7 +115,6 @@ def get_user_double(message: str) -> float: The user input double. """ - def get_user_bool(message: str, default_yes: bool) -> bool: """Prompts the user for a boolean. @@ -135,7 +126,6 @@ def get_user_bool(message: str, default_yes: bool) -> bool: The user input boolean. """ - def get_user_string(message: str) -> str: """Prompts the user for a string. @@ -146,7 +136,6 @@ def get_user_string(message: str) -> str: The user input string. """ - def set_project_name(project_name: str) -> None: """Sets the project name. @@ -154,7 +143,6 @@ def set_project_name(project_name: str) -> None: project_name: The project name. """ - def set_project_number(project_number: str) -> None: """Sets the project number. @@ -162,7 +150,6 @@ def set_project_number(project_number: str) -> None: project_number: The project number. """ - def set_project_part(project_part: str) -> None: """Sets the project part. @@ -170,7 +157,6 @@ def set_project_part(project_part: str) -> None: project_part: The project part. """ - def set_project_architect(project_architect: str) -> None: """Sets the project architect. @@ -178,7 +164,6 @@ def set_project_architect(project_architect: str) -> None: project_architect: The project architect. """ - def set_project_customer(project_customer: str) -> None: """Sets the project customer. @@ -186,7 +171,6 @@ def set_project_customer(project_customer: str) -> None: project_customer: The project customer. """ - def set_project_designer(project_designer: str) -> None: """Sets the project designer. @@ -194,7 +178,6 @@ def set_project_designer(project_designer: str) -> None: project_designer: The project designer. """ - def set_project_deadline(project_deadline: str) -> None: """Sets the project deadline. @@ -202,7 +185,6 @@ def set_project_deadline(project_deadline: str) -> None: project_deadline: The project deadline. """ - def set_project_user_attribute(number: int, user_attribute: str) -> None: """Sets the project user attribute. @@ -211,7 +193,6 @@ def set_project_user_attribute(number: int, user_attribute: str) -> None: user_attribute: The project user attribute. """ - def set_project_user_attribute_name(number: int, user_attribute_name: str) -> None: """Sets the project user attribute name. @@ -220,7 +201,6 @@ def set_project_user_attribute_name(number: int, user_attribute_name: str) -> No user_attribute_name: The project user attribute name. """ - def set_project_latitude(latitude: float) -> None: """Sets the project latitude. @@ -228,7 +208,6 @@ def set_project_latitude(latitude: float) -> None: latitude: The project latitude. """ - def set_project_longitude(longitude: float) -> None: """Sets the project longitude. @@ -236,7 +215,6 @@ def set_project_longitude(longitude: float) -> None: longitude: The project longitude. """ - def set_project_address(address: str) -> None: """Sets the project address. @@ -244,7 +222,6 @@ def set_project_address(address: str) -> None: address: The project address. """ - def set_project_postal_code(postal_code: str) -> None: """Sets the project postal code. @@ -252,7 +229,6 @@ def set_project_postal_code(postal_code: str) -> None: postal_code: The project postal code. """ - def set_project_city(city: str) -> None: """Sets the project city. @@ -260,7 +236,6 @@ def set_project_city(city: str) -> None: city: The project city. """ - def set_project_country(country: str) -> None: """Sets the project country. @@ -268,7 +243,6 @@ def set_project_country(country: str) -> None: country: The project country. """ - def get_user_file_from_dialog(name_filter: str) -> str: """Gets a file with a dialog. @@ -279,7 +253,6 @@ def get_user_file_from_dialog(name_filter: str) -> str: The file path. """ - def get_client_number() -> str: """Gets the client number. @@ -287,7 +260,6 @@ def get_client_number() -> str: The client number. """ - def get_user_point() -> point_3d: """Gets a point from the user. @@ -295,18 +267,16 @@ def get_user_point() -> point_3d: The user point. """ - def disable_auto_display_refresh() -> None: """Disables automatic display refresh. - This function prevents the display from updating automatically, - which can significantly improve performance during operations that involve multiple changes or computations. - The display will remain static until explicitly refreshed by the user. + This function prevents the display from updating automatically, + which can significantly improve performance during operations that involve multiple changes or computations. + The display will remain static until explicitly refreshed by the user. """ - def enable_auto_display_refresh() -> None: """Enables automatic display refresh. - This function restores the default behavior where the display updates automatically after each operation. + This function restores the default behavior where the display updates automatically after each operation. Use this function to resume normal display updates after previously disabling them with disable_auto_display_refresh(). It's recommended to call this function after completing operations that required disabled display refreshing. @@ -326,7 +296,6 @@ def enable_auto_display_refresh() -> None: are properly visualized in cadwork. """ - def create_new_guid() -> str: """Creates a new GUID. @@ -334,7 +303,6 @@ def create_new_guid() -> str: The new GUID. """ - def print_to_console(message: str) -> None: """Prints a message to the Cadwork debug console. @@ -342,7 +310,6 @@ def print_to_console(message: str) -> None: message: The message. """ - def export_screen_to_image(file_path: str, factor: int) -> None: """Exports the screen to an image. @@ -351,7 +318,6 @@ def export_screen_to_image(file_path: str, factor: int) -> None: factor: The image factor. """ - def get_new_user_file_from_dialog(name_filter: str) -> str: """Gets a new file with a dialog. @@ -362,7 +328,6 @@ def get_new_user_file_from_dialog(name_filter: str) -> str: The file path. """ - def api_autostart(api_name: str, option: int) -> int: """Sets an API autostart option. @@ -388,7 +353,6 @@ def api_autostart(api_name: str, option: int) -> int: The value of option if the operation is successful, or -1 in case of errors. """ - def enable_autostart(api_name: str) -> None: """Enables autostart for a given API. @@ -396,7 +360,6 @@ def enable_autostart(api_name: str) -> None: api_name: The name of the API for which to enable autostart. """ - def disable_autostart(api_name: str) -> None: """Disables autostart for a given API. @@ -404,7 +367,6 @@ def disable_autostart(api_name: str) -> None: api_name: The name of the API for which to disable autostart. """ - def check_autostart(api_name: str) -> bool: """Checks if autostart is enabled for a given API. @@ -415,7 +377,6 @@ def check_autostart(api_name: str) -> bool: True if autostart is enabled, false otherwise. """ - def delete_project_data(element_id: str) -> None: """Deletes the project data. @@ -423,7 +384,6 @@ def delete_project_data(element_id: str) -> None: element_id: The project data id. """ - def run_external_program(name: str) -> bool: """Runs a 3D external program. @@ -434,11 +394,8 @@ def run_external_program(name: str) -> bool: False if the program could not be run, true otherwise. """ - def save_3d_file_silently() -> None: - """Saves the 3D file silently. - """ - + """Saves the 3D file silently.""" def get_licence_first_part() -> str: """Gets the first part of the licence. @@ -447,7 +404,6 @@ def get_licence_first_part() -> str: The first part of the licence. """ - def get_licence_second_part() -> str: """Gets the second part of the licence. @@ -455,11 +411,8 @@ def get_licence_second_part() -> str: The second part of the licence. """ - def show_progress_bar() -> None: - """Shows a ProgressBar in the CommandBar. - """ - + """Shows a ProgressBar in the CommandBar.""" def update_progress_bar(value: int) -> None: """Updates the ProgressBar with a value. @@ -468,11 +421,8 @@ def update_progress_bar(value: int) -> None: value: A value between 0 and 100. """ - def hide_progress_bar() -> None: - """Hides the ProgressBar. - """ - + """Hides the ProgressBar.""" def get_user_color(initial_color: int) -> int: """Gets a color choosen by the user. @@ -484,7 +434,6 @@ def get_user_color(initial_color: int) -> int: The color number. """ - def get_3d_linear_units() -> str: """Gets the current linear units. @@ -492,7 +441,6 @@ def get_3d_linear_units() -> str: The current linear units. """ - def get_3d_linear_display_units() -> str: """Gets the current display units. @@ -500,7 +448,6 @@ def get_3d_linear_display_units() -> str: The current display units. """ - def get_3d_angular_units() -> str: """Gets the current angular units. @@ -508,7 +455,6 @@ def get_3d_angular_units() -> str: The current angular units. """ - def get_3d_angular_display_units() -> str: """Gets the current angular display units. @@ -516,7 +462,6 @@ def get_3d_angular_display_units() -> str: The current angular display units. """ - def get_3d_build_date() -> str: """Gets the current build date. @@ -524,7 +469,6 @@ def get_3d_build_date() -> str: The current build date. """ - def set_project_elevation(elevation: float) -> None: """Sets the project elevation. @@ -532,31 +476,20 @@ def set_project_elevation(elevation: float) -> None: elevation: The project elevation. """ - def clear_errors() -> None: - """Clears all errors. - """ - + """Clears all errors.""" def push_check_and_query_data() -> None: - """Pushes the current state of check and query data onto a stack. - """ - + """Pushes the current state of check and query data onto a stack.""" def pop_check_and_query_data() -> None: - """Pops the most recent state of check and query data from the stack. - """ - + """Pops the most recent state of check and query data from the stack.""" def change_check_and_query_data_to_no_queries() -> None: - """Changes the current state of check and query data to no queries. - """ - + """Changes the current state of check and query data to no queries.""" def change_check_and_query_data_to_queries() -> None: - """Changes the current state of check and query data to allow queries. - """ - + """Changes the current state of check and query data to allow queries.""" def is_direct_info_enabled() -> bool: """Checks if Direct Info is enabled. @@ -565,16 +498,11 @@ def is_direct_info_enabled() -> bool: True if Direct Info is enabled, false otherwise. """ - def enable_direct_info() -> None: - """Enables Direct Info. - """ - + """Enables Direct Info.""" def disable_direct_info() -> None: - """Disables Direct Info. - """ - + """Disables Direct Info.""" def load_attribute_display_settings(file_path: str) -> None: """Loads attribute display settings from a file. @@ -583,7 +511,6 @@ def load_attribute_display_settings(file_path: str) -> None: file_path: The path to the file containing the settings. """ - def set_project_description(description: str) -> None: """Sets the project description. @@ -591,16 +518,11 @@ def set_project_description(description: str) -> None: description: The new description for the project. """ - def start_project_data_dialog() -> None: - """Starts the project data dialog. - """ - + """Starts the project data dialog.""" def init_LxSDK() -> None: - """Initializes the LxSDK. - """ - + """Initializes the LxSDK.""" def load_element_attribute_display_settings(file_path: str, elements: list[ElementId]) -> None: """Loads element attribute display settings from a file. @@ -610,7 +532,6 @@ def load_element_attribute_display_settings(file_path: str, elements: list[Eleme elements: The element list for which to load the settings. """ - def get_global_x_offset() -> float: """Gets the global X offset. @@ -618,7 +539,6 @@ def get_global_x_offset() -> float: The global X offset. """ - def set_global_x_offset(offset: float) -> None: """Sets the global X offset. @@ -626,7 +546,6 @@ def set_global_x_offset(offset: float) -> None: offset: The new global X offset. """ - def get_global_y_offset() -> float: """Gets the global Y offset. @@ -634,7 +553,6 @@ def get_global_y_offset() -> float: The global Y offset. """ - def set_global_y_offset(offset: float) -> None: """Sets the global Y offset. @@ -642,7 +560,6 @@ def set_global_y_offset(offset: float) -> None: offset: The new global Y offset. """ - def get_global_z_offset() -> float: """Gets the global Z offset. @@ -650,7 +567,6 @@ def get_global_z_offset() -> float: The global Z offset. """ - def set_global_z_offset(offset: float) -> None: """Sets the global Z offset. @@ -658,16 +574,11 @@ def set_global_z_offset(offset: float) -> None: offset: The new global Z offset. """ - def show_north_arrow() -> None: - """Shows the north arrow on the 3D view. - """ - + """Shows the north arrow on the 3D view.""" def hide_north_arrow() -> None: - """Hides the north arrow on the 3D view. - """ - + """Hides the north arrow on the 3D view.""" def is_north_arrow_visible() -> bool: """Checks if the north arrow is visible on the 3D view. @@ -676,7 +587,6 @@ def is_north_arrow_visible() -> bool: True if the north arrow is visible, false otherwise. """ - def get_north_angle() -> float: """Gets the angle of the north direction. @@ -684,7 +594,6 @@ def get_north_angle() -> float: The angle of the north direction in degrees. """ - def set_north_angle(north_angle: float) -> None: """Sets the angle of the north direction. @@ -692,7 +601,6 @@ def set_north_angle(north_angle: float) -> None: north_angle: The angle of the north direction in degrees. """ - def get_user_file_from_dialog_in_path(name_filter: str, path: str) -> str: """Gets a user file from a dialog in a specified path. @@ -704,7 +612,6 @@ def get_user_file_from_dialog_in_path(name_filter: str, path: str) -> str: A string containing the user file. """ - def get_new_user_file_from_dialog_in_path(name_filter: str, path: str) -> str: """Gets a new user file from a dialog in a specified path. @@ -716,16 +623,11 @@ def get_new_user_file_from_dialog_in_path(name_filter: str, path: str) -> str: A string containing the new user file. """ - def enable_update_variant() -> None: - """Enables the update variant. - """ - + """Enables the update variant.""" def disable_update_variant() -> None: - """Disables the update variant. - """ - + """Disables the update variant.""" def get_user_points() -> list[point_3d]: """Gets user points. @@ -734,7 +636,6 @@ def get_user_points() -> list[point_3d]: A list of user points. """ - def get_user_points_with_count(count: int) -> list[point_3d]: """Gets user points with a specified count. @@ -745,7 +646,6 @@ def get_user_points_with_count(count: int) -> list[point_3d]: A list of user points. """ - def get_user_path_from_dialog() -> str: """Gets the user path from a dialog. @@ -753,7 +653,6 @@ def get_user_path_from_dialog() -> str: A string containing the user path. """ - def get_user_path_from_dialog_in_path(path: str) -> str: """Gets the user path from a dialog in a specified path. @@ -764,7 +663,6 @@ def get_user_path_from_dialog_in_path(path: str) -> str: A string containing the user path. """ - def execute_shortcut(shortcut_key_modifier: shortcut_key_modifier, shortcut_key: shortcut_key) -> None: """Executes a shortcut. @@ -773,7 +671,6 @@ def execute_shortcut(shortcut_key_modifier: shortcut_key_modifier, shortcut_key: shortcut_key: The key for the shortcut. """ - def run_external_program_from_custom_directory(file_path: str) -> bool: """Runs a 3D external program from a custom directory. @@ -784,7 +681,6 @@ def run_external_program_from_custom_directory(file_path: str) -> bool: False if error, true otherwise. """ - def get_3d_file_name() -> str: """Gets the 3D file name. @@ -792,7 +688,6 @@ def get_3d_file_name() -> str: The 3D file name. """ - def get_project_data(element_id: str) -> str: """Gets the project data. @@ -803,7 +698,6 @@ def get_project_data(element_id: str) -> str: The project data. """ - def get_project_name() -> str: """Gets the project name. @@ -811,7 +705,6 @@ def get_project_name() -> str: The project name. """ - def get_project_part() -> str: """Gets the project part. @@ -819,7 +712,6 @@ def get_project_part() -> str: The project part. """ - def get_project_architect() -> str: """Gets the project architect. @@ -827,7 +719,6 @@ def get_project_architect() -> str: The project architect. """ - def get_project_number() -> str: """Gets the project number. @@ -835,7 +726,6 @@ def get_project_number() -> str: The project number. """ - def get_project_customer() -> str: """Gets the project customer. @@ -843,7 +733,6 @@ def get_project_customer() -> str: The project customer. """ - def get_project_designer() -> str: """Gets the project designer. @@ -851,7 +740,6 @@ def get_project_designer() -> str: The project designer. """ - def get_project_deadline() -> str: """Gets the project deadline. @@ -859,7 +747,6 @@ def get_project_deadline() -> str: The project deadline. """ - def get_project_user_attribute(number: int) -> str: """Gets the project user attribute. @@ -870,7 +757,6 @@ def get_project_user_attribute(number: int) -> str: The project user attribute. """ - def get_project_user_attribute_name(number: int) -> str: """Gets the project user attribute name. @@ -881,7 +767,6 @@ def get_project_user_attribute_name(number: int) -> str: The project user attribute name. """ - def get_project_latitude() -> float: """Gets the project latitude. @@ -889,7 +774,6 @@ def get_project_latitude() -> float: The project latitude. """ - def get_project_longitude() -> float: """Gets the project longitude. @@ -897,7 +781,6 @@ def get_project_longitude() -> float: The project longitude. """ - def get_project_postal_code() -> str: """Gets the project postal code. @@ -905,7 +788,6 @@ def get_project_postal_code() -> str: The project postal code. """ - def get_project_address() -> str: """Gets the project address. @@ -913,7 +795,6 @@ def get_project_address() -> str: The project address. """ - def get_project_city() -> str: """Gets the project city. @@ -921,7 +802,6 @@ def get_project_city() -> str: The project city. """ - def get_project_country() -> str: """Gets the project country. @@ -929,7 +809,6 @@ def get_project_country() -> str: The project country. """ - def get_project_elevation() -> float: """Gets the project elevation. @@ -937,7 +816,6 @@ def get_project_elevation() -> float: The project elevation. """ - def get_project_description() -> str: """Gets the project description. @@ -945,7 +823,6 @@ def get_project_description() -> str: A string containing the project description. """ - def get_project_guid() -> str: """Gets the project GUID. @@ -953,7 +830,6 @@ def get_project_guid() -> str: The project GUID. """ - def get_3d_userprofil_path() -> str: """Gets the 3D userprofil path. @@ -961,7 +837,6 @@ def get_3d_userprofil_path() -> str: The 3D userprofil path. """ - def get_plugin_path() -> str: """Gets the plugin path. @@ -969,7 +844,6 @@ def get_plugin_path() -> str: A string containing the plugin path. """ - def get_millimetre_from_imperial_string(value: str) -> float: """Converts an imperial string to millimetres. @@ -980,7 +854,6 @@ def get_millimetre_from_imperial_string(value: str) -> float: The value in millimetres. """ - def get_imperial_string_from_millimetre(value: float) -> str: """Converts a value in millimetres to an imperial string. @@ -991,7 +864,6 @@ def get_imperial_string_from_millimetre(value: float) -> str: The value as an imperial string. """ - def get_user_catalog_path() -> str: """Gets the user catalog path. @@ -999,7 +871,6 @@ def get_user_catalog_path() -> str: A string containing the user catalog path. """ - def get_3d_hwnd() -> int: """Gets the 3D HWND. @@ -1007,16 +878,11 @@ def get_3d_hwnd() -> int: The 3D HWND. """ - def close_cadwork_document_saved() -> None: - """close cadwork saved. - """ - + """close cadwork saved.""" def close_cadwork_document_unsaved() -> None: - """close cadwork unsaved. - """ - + """close cadwork unsaved.""" def get_use_of_global_coordinates() -> bool: """Gets the use of global coordinates. @@ -1025,7 +891,6 @@ def get_use_of_global_coordinates() -> bool: True if global coordinates are used, false otherwise. """ - def set_use_of_global_coordinates(use_of_global_coordinates: bool) -> None: """Sets the use of global coordinates. @@ -1033,7 +898,6 @@ def set_use_of_global_coordinates(use_of_global_coordinates: bool) -> None: use_of_global_coordinates: True to use global coordinates, false otherwise. """ - def get_global_origin() -> point_3d: """Gets the global origin. @@ -1041,7 +905,6 @@ def get_global_origin() -> point_3d: The global origin. """ - def set_global_origin(global_origin: point_3d) -> None: """Sets the global origin. @@ -1049,7 +912,6 @@ def set_global_origin(global_origin: point_3d) -> None: global_origin: The global origin. """ - def create_snapshot() -> str: """Get snapshot from screen. @@ -1057,7 +919,6 @@ def create_snapshot() -> str: The snapshot as a string. """ - def get_3d_gui_upper_left_screen_coordinates() -> tuple[int, int]: """Get the coordinates of the upper left corner of the 3D GUI. @@ -1065,7 +926,6 @@ def get_3d_gui_upper_left_screen_coordinates() -> tuple[int, int]: The coordinates of the upper left corner of the 3D GUI. """ - def get_3d_main_window_geometry() -> 'window_geometry': """Get the geometry of 3d main window. @@ -1073,7 +933,6 @@ def get_3d_main_window_geometry() -> 'window_geometry': The geometry of the 3D main window. """ - def get_project_data_keys() -> list[str]: """Gets all keys for project data. @@ -1081,7 +940,6 @@ def get_project_data_keys() -> list[str]: The list of project data keys. """ - def get_user_int_with_default_value(message: str, default_value: int) -> int: """Prompts the user for an integer with a default value. @@ -1093,7 +951,6 @@ def get_user_int_with_default_value(message: str, default_value: int) -> int: The user integer. """ - def get_user_double_with_default_value(message: str, default_value: float) -> float: """Prompts the user for a double with a default value. @@ -1105,7 +962,6 @@ def get_user_double_with_default_value(message: str, default_value: float) -> fl The user double. """ - def get_user_string_with_default_value(message: str, default_value: str) -> str: """Prompts the user for a string with a default value. @@ -1117,7 +973,6 @@ def get_user_string_with_default_value(message: str, default_value: str) -> str: The user string. """ - def get_3d_version_name() -> str: """Gets the 3D version name. @@ -1125,9 +980,8 @@ def get_3d_version_name() -> str: The 3D version name. """ - def redirect_python_output_to_logger() -> None: """Redirects output from Python's print function to the cadwork logger. - This function is used to redirect the output of the Python interpreter to the logger. - This is useful for debugging and logging purposes. + This function is used to redirect the output of the Python interpreter to the logger. + This is useful for debugging and logging purposes. """ diff --git a/src/visualization_controller/__init__.pyi b/src/visualization_controller/__init__.pyi index 6563988..fad44cd 100644 --- a/src/visualization_controller/__init__.pyi +++ b/src/visualization_controller/__init__.pyi @@ -102,24 +102,19 @@ def set_mutable(element_id_list: list[ElementId]) -> None: """ def show_all_elements() -> None: - """Shows all elements. - """ + """Shows all elements.""" def hide_all_elements() -> None: - """Hides all elements. - """ + """Hides all elements.""" def zoom_all_elements() -> None: - """Zooms on all elements. - """ + """Zooms on all elements.""" def zoom_active_elements() -> None: - """Zooms on all active elements. - """ + """Zooms on all active elements.""" def refresh() -> None: - """Refresh the drawing area. - """ + """Refresh the drawing area.""" def set_material(element_id_list: list[ElementId], element_id: ElementId) -> None: """Sets the element material. @@ -129,7 +124,7 @@ def set_material(element_id_list: list[ElementId], element_id: ElementId) -> Non element_id: The material ID to set. """ -def save_visibility_state() -> "visibility_state": +def save_visibility_state() -> 'visibility_state': """Saves the visibility state. Returns: @@ -143,7 +138,7 @@ def restore_visibility_state(state: None) -> None: state: The visibility state to restore. """ -def save_activation_state() -> "activation_state": +def save_activation_state() -> 'activation_state': """Saves the activation state. Returns: @@ -158,52 +153,40 @@ def restore_activation_state(state: None) -> None: """ def show_view_positive_x() -> None: - """Sets the view to +X. - """ + """Sets the view to +X.""" def show_view_negative_x() -> None: - """Sets the view to -X. - """ + """Sets the view to -X.""" def show_view_positive_y() -> None: - """Sets the view to +Y. - """ + """Sets the view to +Y.""" def show_view_negative_y() -> None: - """Sets the view to -Y. - """ + """Sets the view to -Y.""" def show_view_positive_z() -> None: - """Sets the view to +Z. - """ + """Sets the view to +Z.""" def show_view_negative_z() -> None: - """Sets the view to -Z. - """ + """Sets the view to -Z.""" def show_view_standard_axo() -> None: - """Sets the view to standard axonometry. - """ + """Sets the view to standard axonometry.""" def show_view_wireframe() -> None: - """Sets the view to wireframe. - """ + """Sets the view to wireframe.""" def show_view_hidden_lines() -> None: - """Sets the view to hidden lines. - """ + """Sets the view to hidden lines.""" def show_view_dashed_hidden_lines() -> None: - """Sets the view to dashed hidden lines. - """ + """Sets the view to dashed hidden lines.""" def show_view_shaded2() -> None: - """Sets the view to shaded 2. - """ + """Sets the view to shaded 2.""" def show_view_shaded1() -> None: - """Sets the view to shaded 1. - """ + """Sets the view to shaded 1.""" def is_selectable(element_id: ElementId) -> bool: """Returns if the element is selectable. @@ -230,8 +213,7 @@ def set_selectable(element_id_list: list[ElementId]) -> None: """ def clear_errors() -> None: - """Clears all errors. - """ + """Clears all errors.""" def load_marking_settings(settings_file_path: str) -> None: """Loads marking settings file. @@ -256,9 +238,7 @@ def set_camera(position: point_3d, target: point_3d) -> None: """ def show_perspective_central() -> None: - """changes the viewmode to Perspective. - """ - + """changes the viewmode to Perspective.""" def set_color_without_material(element_id_list: list[ElementId], color_id: ColorId) -> None: """Sets the color of a list of elements without changing their material. @@ -268,7 +248,6 @@ def set_color_without_material(element_id_list: list[ElementId], color_id: Color color_id: The color ID to set. """ - def set_texture_rotated(element_id_list: list[ElementId], flag: bool) -> None: """Sets the rotation of the texture for a list of elements. @@ -299,8 +278,7 @@ def show_reference_side_wall(show: bool) -> None: """ def show_view_axo() -> None: - """changes the viewmode to Axo. - """ + """changes the viewmode to Axo.""" def get_color(element_id: ElementId) -> int: """Gets the element color. @@ -312,7 +290,6 @@ def get_color(element_id: ElementId) -> int: The color ID of the element. """ - def get_opengl_color(element_id: ElementId) -> rgb_color: """Gets the element OpenGL color. @@ -333,7 +310,6 @@ def get_material(element_id: ElementId) -> MaterialId: The material id. """ - def get_rgb_from_cadwork_color_id(color_id: ColorId) -> rgb_color: """Gets the RGB color from a Cadwork color ID. @@ -344,7 +320,6 @@ def get_rgb_from_cadwork_color_id(color_id: ColorId) -> rgb_color: The RGB color corresponding to the Cadwork color ID. """ - def is_texture_rotated(element_id: ElementId) -> bool: """Checks if the texture of an element is rotated. @@ -362,7 +337,6 @@ def get_camera_data() -> camera_data: The camera data. """ - def set_camera_data(camera_data: camera_data) -> None: """Set the camera data - this will override the current camera data. @@ -384,7 +358,7 @@ def is_cadwork_window_in_dark_mode() -> bool: True if the window is in dark mode, false otherwise. """ -def enter_working_plane(plane_normal: point_3d, plane_origin: point_3d) ->None: +def enter_working_plane(plane_normal: point_3d, plane_origin: point_3d) -> None: """Enter 2d working plane. Parameters: @@ -392,7 +366,7 @@ def enter_working_plane(plane_normal: point_3d, plane_origin: point_3d) ->None: plane_origin: A plane origin. """ -def get_element_transparency(element_id: ElementId) ->int: +def get_element_transparency(element_id: ElementId) -> int: """Gets the element transparency. Parameters: @@ -428,7 +402,6 @@ def set_use_material_texture(element_id_list: list[ElementId], value: bool) -> N value: True to use material texture, false otherwise. """ - def display_bitmaps_as_texture_representation_in_shaded1(flag: bool) -> None: """Set the graphic option to display bitmaps as textures in shaded 1. @@ -436,7 +409,6 @@ def display_bitmaps_as_texture_representation_in_shaded1(flag: bool) -> None: flag: True to display bitmaps as textures in shaded 1, false otherwise. """ - def display_bitmaps_as_texture_representation_in_shaded2(flag: bool) -> None: """Set the graphic option to display bitmaps as textures in shaded 2. From 48d02f8be194bff3e9febc1464324be2c769ab12 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Paquet Date: Fri, 14 Aug 2026 10:53:45 -0400 Subject: [PATCH 5/7] Updates build process and switches to uv. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c5dbdc..64eed34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,5 +17,7 @@ jobs: - run: uv python install 3.14 - run: uv run pytest --cov --cov-branch --cov-report=xml - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - - run: uv run ruff format --check + with: + token: ${{ secrets.CODECOV_TOKEN }} + - run: uv run ruff check - run: uv build From 907fc67fc8c57a3e18c9202fe5a78cdcea08c2f2 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Paquet Date: Fri, 14 Aug 2026 10:54:56 -0400 Subject: [PATCH 6/7] Updates build process and switches to uv. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64eed34..d840412 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,5 +19,5 @@ jobs: - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: token: ${{ secrets.CODECOV_TOKEN }} - - run: uv run ruff check + - run: uv run ruff format --check - run: uv build From 896f572e3db3e39e931335b9b78a23777ec93be4 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Paquet Date: Fri, 14 Aug 2026 11:04:05 -0400 Subject: [PATCH 7/7] Removes CI workflow on merge. --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d840412..2065c68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,6 @@ on: pull_request: branches: - main - push: - branches: - - main jobs: ci: