From 8d7d084675cf4b7624075e93296470f6878d17b6 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:10:03 +0200 Subject: [PATCH 01/30] [API-519] Updated documentation version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 044efd5..3801c22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cwapi3d" -version = "32.296.0" +version = "32.297.0" authors = [{ name = "Cadwork", email = "it@cadwork.ca" }] requires-python = ">= 3.12" description = 'Python bindings for CwAPI3D' From e162503edb206406061a3f7879ab3391fd07d382 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:10:54 +0200 Subject: [PATCH 02/30] [API-519] Updated python version in conf files --- .github/workflows/publish.yml | 2 +- .github/workflows/test_publish.yml | 2 +- Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8906cb8..61d26e9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - run: pip install build - run: python -m build - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index e92c40f..13d941a 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.13' - run: pip install build - run: python -m build - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/Dockerfile b/Dockerfile index fd991d7..8c973a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.12 WORKDIR /app From c5b168fbdc07ae6cc2ba6bd1200030fdbbf6060e Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:12:57 +0200 Subject: [PATCH 03/30] [API-519] Updated mkdocs.yml to add some sections, change doc style and automatically create hyperlink for known types --- mkdocs.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 53111d9..9e32aed 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,6 +38,8 @@ nav: - Attribute Controller: documentation/attribute_controller.md - BIM Controller: documentation/bim_controller.md - Cadwork: + - Api Types: documentation/api_types.md + - Attribute Display Settings: documentation/attribute_display_settings.md - Element Module Properties: documentation/element_module_properties.md - Element Type: documentation/element_type.md - Process Type: documentation/process_type.md @@ -133,8 +135,18 @@ extra_css: - https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.css plugins: - - mkdocstrings - search + - autorefs # Automatically generate references for known types and functions + - mkdocstrings: + handlers: + python: + paths: [src] # Directory containing Python modules + options: + show_signature_annotations: true + show_type_annotations: true + docstring_style: google # Set the docstring style + cross_reference: true # Enable cross-referencing to make links to classes, methods, and functions + show_source: false # Disable source code display extra: social: From 0be7bd88d0d68c047572a13615bd0b1aadb32394 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:14:03 +0200 Subject: [PATCH 04/30] [API-519] Updated custom js script to delete the last column in the automatically generated doc tab --- docs/js/tablesort.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/js/tablesort.js b/docs/js/tablesort.js index 98717ae..4d659ea 100644 --- a/docs/js/tablesort.js +++ b/docs/js/tablesort.js @@ -1,6 +1,11 @@ document$.subscribe(function () { var tables = document.querySelectorAll("article table:not([class])") + + tables.forEach(function (table) { - new Tablesort(table) + table.querySelectorAll('tr').forEach(row => { + if(row.children[3]) row.children[3].style.display = 'none'; // Hide the 4th column + }) + new Tablesort(table) // Initialize Tablesort on the table }) -}) +}) \ No newline at end of file From aeec145b6b3d2ad75094bff2f9ab373b2d149d43 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:15:55 +0200 Subject: [PATCH 05/30] [API-519] Removed the "src." in the module path in the doc section config to fix the cross module links --- docs/documentation/attribute_controller.md | 2 +- docs/documentation/bim_controller.md | 2 +- docs/documentation/bim_team_upload_result.md | 2 +- docs/documentation/brep_data.md | 8 ++--- docs/documentation/camera_data.md | 4 +-- .../connector_axis_controller.md | 2 +- docs/documentation/dimension_controller.md | 2 +- docs/documentation/element_controller.md | 2 +- docs/documentation/element_filter.md | 2 +- docs/documentation/element_map_query.md | 2 +- .../element_module_properties.md | 2 +- docs/documentation/element_type.md | 2 +- docs/documentation/endtype_controller.md | 2 +- docs/documentation/enums.md | 30 +++++++++---------- docs/documentation/extended_settings.md | 2 +- docs/documentation/file_controller.md | 2 +- docs/documentation/geometry_controller.md | 2 +- docs/documentation/hit_result.md | 2 +- docs/documentation/ifc_2x3_element_type.md | 2 +- docs/documentation/ifc_options.md | 10 +++---- docs/documentation/layer_settings.md | 2 +- docs/documentation/list_controller.md | 2 +- docs/documentation/machine_controller.md | 2 +- docs/documentation/material_controller.md | 2 +- docs/documentation/menu_controller.md | 2 +- .../multi_layer_cover_controller.md | 2 +- docs/documentation/point_3d.md | 2 +- docs/documentation/process_type.md | 2 +- docs/documentation/rhino_export_options.md | 2 +- docs/documentation/roof_controller.md | 2 +- docs/documentation/scene_controller.md | 2 +- docs/documentation/shop_drawing_controller.md | 2 +- docs/documentation/shoulder_options.md | 6 ++-- docs/documentation/text_object_options.md | 4 +-- docs/documentation/utility_controller.md | 2 +- .../documentation/visualization_controller.md | 2 +- docs/documentation/window_geometry.md | 2 +- 37 files changed, 62 insertions(+), 62 deletions(-) diff --git a/docs/documentation/attribute_controller.md b/docs/documentation/attribute_controller.md index 850334b..7d372e0 100644 --- a/docs/documentation/attribute_controller.md +++ b/docs/documentation/attribute_controller.md @@ -1,6 +1,6 @@ # Attribute Controller -::: src.attribute_controller +::: attribute_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/bim_controller.md b/docs/documentation/bim_controller.md index 5fb70c9..2ba4033 100644 --- a/docs/documentation/bim_controller.md +++ b/docs/documentation/bim_controller.md @@ -1,6 +1,6 @@ # BIM Controller -::: src.bim_controller +::: bim_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/bim_team_upload_result.md b/docs/documentation/bim_team_upload_result.md index 9480cff..b15c2fd 100644 --- a/docs/documentation/bim_team_upload_result.md +++ b/docs/documentation/bim_team_upload_result.md @@ -1,6 +1,6 @@ # BIMteam upload -::: src.cadwork.bim_team_upload_result +::: cadwork.bim_team_upload_result rendering: show_root_heading: false show_source: true \ No newline at end of file diff --git a/docs/documentation/brep_data.md b/docs/documentation/brep_data.md index 56f91a2..6d27061 100644 --- a/docs/documentation/brep_data.md +++ b/docs/documentation/brep_data.md @@ -1,21 +1,21 @@ # BREP -::: src.cadwork.facet_list +::: cadwork.facet_list rendering: show_root_heading: false show_source: true -::: src.cadwork.edge_list +::: cadwork.edge_list rendering: show_root_heading: false show_source: true -::: src.cadwork.polygon_list +::: cadwork.polygon_list rendering: show_root_heading: false show_source: true -::: src.cadwork.vertex_list +::: cadwork.vertex_list rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/camera_data.md b/docs/documentation/camera_data.md index 48c5643..08e7de2 100644 --- a/docs/documentation/camera_data.md +++ b/docs/documentation/camera_data.md @@ -1,11 +1,11 @@ # Camera Data -::: src.cadwork.camera_data +::: cadwork.camera_data rendering: show_root_heading: false show_source: true -::: src.cadwork.projection_type +::: cadwork.projection_type rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/connector_axis_controller.md b/docs/documentation/connector_axis_controller.md index 46c236a..139d862 100644 --- a/docs/documentation/connector_axis_controller.md +++ b/docs/documentation/connector_axis_controller.md @@ -1,6 +1,6 @@ # Connector Axis Controller -::: src.connector_axis_controller +::: connector_axis_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/dimension_controller.md b/docs/documentation/dimension_controller.md index a1a2d23..906f076 100644 --- a/docs/documentation/dimension_controller.md +++ b/docs/documentation/dimension_controller.md @@ -1,6 +1,6 @@ # Dimension Controller -::: src.dimension_controller +::: dimension_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/element_controller.md b/docs/documentation/element_controller.md index 7abf8a3..12a4049 100644 --- a/docs/documentation/element_controller.md +++ b/docs/documentation/element_controller.md @@ -1,6 +1,6 @@ # Element Controller -::: src.element_controller +::: element_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/element_filter.md b/docs/documentation/element_filter.md index 6560517..b6b54ae 100644 --- a/docs/documentation/element_filter.md +++ b/docs/documentation/element_filter.md @@ -1,6 +1,6 @@ # element_filter -::: src.cadwork.element_filter +::: cadwork.element_filter rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/element_map_query.md b/docs/documentation/element_map_query.md index 48e1c63..c378158 100644 --- a/docs/documentation/element_map_query.md +++ b/docs/documentation/element_map_query.md @@ -1,6 +1,6 @@ # element_map_query -::: src.cadwork.element_map_query +::: cadwork.element_map_query rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/element_module_properties.md b/docs/documentation/element_module_properties.md index d5f6ef4..0d98804 100644 --- a/docs/documentation/element_module_properties.md +++ b/docs/documentation/element_module_properties.md @@ -1,6 +1,6 @@ # element_module_properties -::: src.cadwork.element_module_properties +::: cadwork.element_module_properties rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/element_type.md b/docs/documentation/element_type.md index c6a897c..86c07b2 100644 --- a/docs/documentation/element_type.md +++ b/docs/documentation/element_type.md @@ -1,6 +1,6 @@ # element_type -::: src.cadwork.element_type +::: cadwork.element_type rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/endtype_controller.md b/docs/documentation/endtype_controller.md index 6552168..efc2c01 100644 --- a/docs/documentation/endtype_controller.md +++ b/docs/documentation/endtype_controller.md @@ -1,6 +1,6 @@ # End-Type Controller -::: src.endtype_controller +::: endtype_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/enums.md b/docs/documentation/enums.md index 6c3f0e3..4d0b46f 100644 --- a/docs/documentation/enums.md +++ b/docs/documentation/enums.md @@ -2,95 +2,95 @@ ## Node symbols -::: src.cadwork.node_symbol +::: cadwork.node_symbol rendering: show_root_heading: false show_source: true ## Element module -::: src.cadwork.element_module_detail +::: cadwork.element_module_detail rendering: show_root_heading: false show_source: true -::: src.cadwork.division_zone_direction +::: cadwork.division_zone_direction rendering: show_root_heading: false show_source: true -::: src.cadwork.element_grouping_type +::: cadwork.element_grouping_type rendering: show_root_heading: false show_source: true ## F-Keys -::: src.cadwork.shortcut_key +::: cadwork.shortcut_key rendering: show_root_heading: false show_source: true -::: src.cadwork.shortcut_key_modifier +::: cadwork.shortcut_key_modifier rendering: show_root_heading: false show_source: true ## Machines -::: src.cadwork.btl_version +::: cadwork.btl_version rendering: show_root_heading: false show_source: true -::: src.cadwork.hundegger_machine_type +::: cadwork.hundegger_machine_type rendering: show_root_heading: false show_source: true -::: src.cadwork.weinmann_mfb_version +::: cadwork.weinmann_mfb_version rendering: show_root_heading: false show_source: true ## IFC Aggregation Behaviour -::: src.cadwork.ifc_element_combine_behaviour +::: cadwork.ifc_element_combine_behaviour rendering: show_root_heading: false show_source: true ## Multi Layer Cover Type -::: src.cadwork.multi_layer_type +::: cadwork.multi_layer_type rendering: show_root_heading: false show_source: true ## BIMteam upload -::: src.cadwork.bim_team_upload_result_code +::: cadwork.bim_team_upload_result_code rendering: show_root_heading: false show_source: true ### Dimenson base format -::: src.cadwork.dimension_base_format +::: cadwork.dimension_base_format rendering: show_root_heading: false show_source: true ### DXF export version -::: src.cadwork.dxf_export_version +::: cadwork.dxf_export_version rendering: show_root_heading: false show_source: true ### DXF layer format type -::: src.cadwork.dxf_layer_format_type +::: cadwork.dxf_layer_format_type rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/extended_settings.md b/docs/documentation/extended_settings.md index aac68de..ee3acda 100644 --- a/docs/documentation/extended_settings.md +++ b/docs/documentation/extended_settings.md @@ -1,6 +1,6 @@ # extended_settings -::: src.cadwork.extended_settings +::: cadwork.extended_settings rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/file_controller.md b/docs/documentation/file_controller.md index 2e77d4c..148a6da 100644 --- a/docs/documentation/file_controller.md +++ b/docs/documentation/file_controller.md @@ -1,6 +1,6 @@ # File Controller -::: src.file_controller +::: file_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/geometry_controller.md b/docs/documentation/geometry_controller.md index 1572b8e..5ead026 100644 --- a/docs/documentation/geometry_controller.md +++ b/docs/documentation/geometry_controller.md @@ -1,6 +1,6 @@ # Geometry Controller -::: src.geometry_controller +::: geometry_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/hit_result.md b/docs/documentation/hit_result.md index 6fae9fb..d974af8 100644 --- a/docs/documentation/hit_result.md +++ b/docs/documentation/hit_result.md @@ -1,6 +1,6 @@ # hit_result -::: src.cadwork.hit_result +::: cadwork.hit_result rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/ifc_2x3_element_type.md b/docs/documentation/ifc_2x3_element_type.md index 52c866d..05191f6 100644 --- a/docs/documentation/ifc_2x3_element_type.md +++ b/docs/documentation/ifc_2x3_element_type.md @@ -1,6 +1,6 @@ # ifc_2x3_element_type -::: src.cadwork.ifc_2x3_element_type +::: cadwork.ifc_2x3_element_type rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/ifc_options.md b/docs/documentation/ifc_options.md index 4bb3a3d..49fb18d 100644 --- a/docs/documentation/ifc_options.md +++ b/docs/documentation/ifc_options.md @@ -1,26 +1,26 @@ # IFC Options -::: src.cadwork.ifc_options +::: cadwork.ifc_options rendering: show_root_heading: false show_source: true -::: src.cadwork.ifc_options_aggregation +::: cadwork.ifc_options_aggregation rendering: show_root_heading: false show_source: true -::: src.cadwork.ifc_options_level_of_detail +::: cadwork.ifc_options_level_of_detail rendering: show_root_heading: false show_source: true -::: src.cadwork.ifc_options_project_data +::: cadwork.ifc_options_project_data rendering: show_root_heading: false show_source: true -::: src.cadwork.ifc_options_properties +::: cadwork.ifc_options_properties rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/layer_settings.md b/docs/documentation/layer_settings.md index d56c0e7..06b8d59 100644 --- a/docs/documentation/layer_settings.md +++ b/docs/documentation/layer_settings.md @@ -1,6 +1,6 @@ # Layer Settings -::: src.cadwork.layer_settings +::: cadwork.layer_settings rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/list_controller.md b/docs/documentation/list_controller.md index 1d8fa3e..7564e75 100644 --- a/docs/documentation/list_controller.md +++ b/docs/documentation/list_controller.md @@ -1,6 +1,6 @@ # List Controller -::: src.list_controller +::: list_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/machine_controller.md b/docs/documentation/machine_controller.md index f5b5415..9a40c80 100644 --- a/docs/documentation/machine_controller.md +++ b/docs/documentation/machine_controller.md @@ -1,6 +1,6 @@ # Machine Controller -::: src.machine_controller +::: machine_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/material_controller.md b/docs/documentation/material_controller.md index f76ecde..218d0b4 100644 --- a/docs/documentation/material_controller.md +++ b/docs/documentation/material_controller.md @@ -1,6 +1,6 @@ # Material Controller -::: src.material_controller +::: material_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/menu_controller.md b/docs/documentation/menu_controller.md index 8d5e890..38b129e 100644 --- a/docs/documentation/menu_controller.md +++ b/docs/documentation/menu_controller.md @@ -1,6 +1,6 @@ # Menu Controller -::: src.menu_controller +::: menu_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/multi_layer_cover_controller.md b/docs/documentation/multi_layer_cover_controller.md index dc78ddf..6f73ee9 100644 --- a/docs/documentation/multi_layer_cover_controller.md +++ b/docs/documentation/multi_layer_cover_controller.md @@ -1,6 +1,6 @@ # Multi Layer Cover Controller -::: src.multi_layer_cover_controller +::: multi_layer_cover_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/point_3d.md b/docs/documentation/point_3d.md index 0e7dd15..95af39f 100644 --- a/docs/documentation/point_3d.md +++ b/docs/documentation/point_3d.md @@ -1,6 +1,6 @@ # point_3d -::: src.cadwork.point_3d +::: cadwork.point_3d rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/process_type.md b/docs/documentation/process_type.md index ea04168..095a950 100644 --- a/docs/documentation/process_type.md +++ b/docs/documentation/process_type.md @@ -1,6 +1,6 @@ # process_type -::: src.cadwork.process_type +::: cadwork.process_type rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/rhino_export_options.md b/docs/documentation/rhino_export_options.md index a68a8e9..62d4b81 100644 --- a/docs/documentation/rhino_export_options.md +++ b/docs/documentation/rhino_export_options.md @@ -1,6 +1,6 @@ # rhino_options -::: src.cadwork.rhino_options +::: cadwork.rhino_options rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/roof_controller.md b/docs/documentation/roof_controller.md index 094f6cf..66efda1 100644 --- a/docs/documentation/roof_controller.md +++ b/docs/documentation/roof_controller.md @@ -1,6 +1,6 @@ # Roof Controller -::: src.roof_controller +::: roof_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/scene_controller.md b/docs/documentation/scene_controller.md index 60fb920..1719974 100644 --- a/docs/documentation/scene_controller.md +++ b/docs/documentation/scene_controller.md @@ -1,6 +1,6 @@ # Scene Controller -::: src.scene_controller +::: scene_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/shop_drawing_controller.md b/docs/documentation/shop_drawing_controller.md index 6eaddc8..45be541 100644 --- a/docs/documentation/shop_drawing_controller.md +++ b/docs/documentation/shop_drawing_controller.md @@ -1,6 +1,6 @@ # Shop Drawing Controller -::: src.shop_drawing_controller +::: shop_drawing_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/shoulder_options.md b/docs/documentation/shoulder_options.md index b0ca2c8..6b5547b 100644 --- a/docs/documentation/shoulder_options.md +++ b/docs/documentation/shoulder_options.md @@ -1,16 +1,16 @@ # Shoulder options -::: src.cadwork.double_shoulder_options +::: cadwork.double_shoulder_options rendering: show_root_heading: false show_source: true -::: src.cadwork.heel_shoulder_beam_geometry +::: cadwork.heel_shoulder_beam_geometry rendering: show_root_heading: false show_source: true -::: src.cadwork.heel_shoulder_options +::: cadwork.heel_shoulder_options rendering: show_root_heading: false show_source: true \ No newline at end of file diff --git a/docs/documentation/text_object_options.md b/docs/documentation/text_object_options.md index 196567f..5e77c6b 100644 --- a/docs/documentation/text_object_options.md +++ b/docs/documentation/text_object_options.md @@ -1,11 +1,11 @@ # Text Object Options -::: src.cadwork.text_object_options +::: cadwork.text_object_options rendering: show_root_heading: false show_source: true -::: src.cadwork.text_element_type +::: cadwork.text_element_type rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/utility_controller.md b/docs/documentation/utility_controller.md index c3f8c00..6c712a0 100644 --- a/docs/documentation/utility_controller.md +++ b/docs/documentation/utility_controller.md @@ -1,6 +1,6 @@ # Utility Controller -::: src.utility_controller +::: utility_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/visualization_controller.md b/docs/documentation/visualization_controller.md index 29d8c5e..77690ce 100644 --- a/docs/documentation/visualization_controller.md +++ b/docs/documentation/visualization_controller.md @@ -1,6 +1,6 @@ # Visualization Controller -::: src.visualization_controller +::: visualization_controller rendering: show_root_heading: false show_source: true diff --git a/docs/documentation/window_geometry.md b/docs/documentation/window_geometry.md index 659170d..567ba69 100644 --- a/docs/documentation/window_geometry.md +++ b/docs/documentation/window_geometry.md @@ -1,6 +1,6 @@ # window_geometry -::: src.cadwork.window_geometry +::: cadwork.window_geometry rendering: show_root_heading: true show_source: true \ No newline at end of file From aa9e96fb969be5729da5bbd7028ac2f25c368685 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:17:15 +0200 Subject: [PATCH 06/30] [API-519] Added a section about custom types --- docs/documentation/api_types.md | 6 ++++++ src/cadwork/api_types.pyi | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 docs/documentation/api_types.md create mode 100644 src/cadwork/api_types.pyi diff --git a/docs/documentation/api_types.md b/docs/documentation/api_types.md new file mode 100644 index 0000000..081a321 --- /dev/null +++ b/docs/documentation/api_types.md @@ -0,0 +1,6 @@ +# Api Types + +::: cadwork.api_types + rendering: + show_root_heading: false + show_source: true diff --git a/src/cadwork/api_types.pyi b/src/cadwork/api_types.pyi new file mode 100644 index 0000000..7e1d19d --- /dev/null +++ b/src/cadwork/api_types.pyi @@ -0,0 +1,22 @@ +from typing import Annotated + +UnsignedInt = Annotated[int, "Must be >= 0"] +"""""" +MaterialId = Annotated[int, "Must be >= 0"] +"""""" +ColorId = Annotated[int, "Must be >= 0"] +"""""" +EndtypeId = Annotated[int, "Must be >= 0"] +"""""" +AxisId = Annotated[int, "Must be >= 0"] +"""""" +MenuIndex = Annotated[int, "Normal int"] +"""""" +ReferenceSide = Annotated[int, "Must be >= 0"] +"""""" +MultiLayerSetId = Annotated[int, "Must be >= 0"] +"""""" +UserAttributeId = Annotated[int, "Must be >= 0"] +"""""" +ElementId = Annotated[int, "Must be >= 0"] +"""""" \ No newline at end of file From eb3d538a013b4e682b9c2ffa202a0f6cba991398 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:17:48 +0200 Subject: [PATCH 07/30] [API-519] Added a missing class in the doc (attribute_display_settings) --- docs/documentation/attribute_display_settings.md | 6 ++++++ src/cadwork/attribute_display_settings.pyi | 1 + 2 files changed, 7 insertions(+) create mode 100644 docs/documentation/attribute_display_settings.md diff --git a/docs/documentation/attribute_display_settings.md b/docs/documentation/attribute_display_settings.md new file mode 100644 index 0000000..55188ce --- /dev/null +++ b/docs/documentation/attribute_display_settings.md @@ -0,0 +1,6 @@ +# attribute_display_settings + +::: cadwork.attribute_display_settings + rendering: + show_root_heading: false + show_source: true diff --git a/src/cadwork/attribute_display_settings.pyi b/src/cadwork/attribute_display_settings.pyi index 86a2fc7..0491826 100644 --- a/src/cadwork/attribute_display_settings.pyi +++ b/src/cadwork/attribute_display_settings.pyi @@ -1,4 +1,5 @@ class attribute_display_settings: + """attribute display settings""" def get_text_position_percentage(self) -> int: """get text position percentage From 34e909fa9e3c1de0217b712740286ca8953f1e78 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 10:38:42 +0200 Subject: [PATCH 08/30] [API-519] Improved the attribute controller documentation --- src/attribute_controller/__init__.pyi | 1451 +++++++++++-------------- 1 file changed, 624 insertions(+), 827 deletions(-) diff --git a/src/attribute_controller/__init__.pyi b/src/attribute_controller/__init__.pyi index 0bdfaf4..5b947a4 100644 --- a/src/attribute_controller/__init__.pyi +++ b/src/attribute_controller/__init__.pyi @@ -3,1844 +3,1641 @@ from cadwork.attribute_display_settings import attribute_display_settings from cadwork.element_grouping_type import element_grouping_type from cadwork.element_type import element_type from cadwork.extended_settings import extended_settings +from cadwork.layer_settings import layer_settings +from cadwork.node_symbol import node_symbol from cadwork.process_type import process_type +from cadwork.api_types import * -def get_last_error(error_code: int) -> str: - """Gets the last error +def set_name(element_id_list: List[ElementId], name: str) -> None: + """Sets the element name. Parameters: - error_code: error_code - - Returns: - error string + element_id_list: The element id list. + name: The element name. """ -def set_name(element_id_list: List[int], name: str) -> None: - """Sets the element name +def set_group(element_id_list: List[ElementId], group: str) -> None: + """Sets the element group. Parameters: - element_id_list: element_id_list - name: name - - Returns: - None + element_id_list: The element id list. + group: The element group. """ -def set_group(element_id_list: List[int], group: str) -> None: - """Sets the element group +def set_subgroup(element_id_list: List[ElementId], subgroup: str) -> None: + """Sets the element subgroup. Parameters: - element_id_list: element_id_list - group: group - - Returns: - None + element_id_list: The element id list. + subgroup: The element subgroup. """ -def set_subgroup(element_id_list: List[int], subgroup: str) -> None: - """Sets the element subgroup +def set_comment(element_id_list: List[ElementId], comment: str) -> None: + """Sets the element comment. Parameters: - element_id_list: element_id_list - subgroup: subgroup - - Returns: - None + element_id_list: The element id list. + comment: The element comment. """ -def set_comment(element_id_list: List[int], comment: str) -> None: - """Sets the element comment +def set_user_attribute(element_id_list: List[ElementId], number: UserAttributeId, user_attribute: str) -> None: + """Sets the element user attribute. Parameters: - element_id_list: element_id_list - comment: comment - - Returns: - None + element_id_list: The element id list. + number: The user attribute id. + user_attribute: The user attribute. """ -def set_user_attribute(element_id_list: List[int], number: int, user_attribute: str) -> None: - """Sets the element user attribute +def set_sku(element_id_list: List[ElementId], sku: str) -> None: + """Sets the element SKU. Parameters: - element_id_list: element_id_list - number: number - user_attribute: user_attribute - - Returns: - None - """ - -def set_sku(element_id_list: List[int], sku: str) -> None: - """Sets the element SKU - - Parameters: - element_id_list: element_id_list - sku: sku - - Returns: - None + element_id_list: The element id list. + sku: The element SKU. """ -def set_production_number(element_id_list: List[int], production_number: int) -> None: - """Sets the element production number +def set_production_number(element_id_list: List[ElementId], production_number: UnsignedInt) -> None: + """Sets the element production number. Parameters: - element_id_list: element_id_list - production_number: production_number - - Returns: - None + element_id_list: The element id list. + production_number: The element production number. """ -def set_part_number(element_id_list: List[int], part_number: int) -> None: - """Sets the element part number +def set_part_number(element_id_list: List[ElementId], part_number: UnsignedInt) -> None: + """Sets the element part number. Parameters: - element_id_list: element_id_list - part_number: part_number - - Returns: - None + element_id_list: The element id list. + part_number: The element part number. """ -def set_additional_data(element_id_list: List[int], data_id: str, data_text: str) -> None: - """Sets the element additional data +def set_additional_data(element_id_list: List[ElementId], data_id: str, data_text: str) -> None: + """Sets the element additional data. Parameters: - element_id_list: element_id_list - data_id: data_id - data_text: data_text - - Returns: - None + element_id_list: The element id list. + data_id: The data id. + data_text: The element additional data. """ -def delete_additional_data(element_id_list: List[int], data_id: str) -> None: - """Deletes the element additional data +def delete_additional_data(element_id_list: List[ElementId], data_id: str) -> None: + """Deletes the element additional data. Parameters: - element_id_list: element_id_list - data_id: data_id - - Returns: - None + element_id_list: The element id list. + data_id: The data id. """ -def set_user_attribute_name(number: int, user_attribute_name: str) -> None: - """Sets the user attribute name +def set_user_attribute_name(number: UserAttributeId, user_attribute_name: str) -> None: + """Sets the user attribute name. Parameters: - number: number - user_attribute_name: user_attribute_name - - Returns: - None + number: The user attribute id. + user_attribute_name: The user attribute name. """ -def set_process_type_and_extended_settings_from_name(element_id_list: List[int]) -> None: - """Sets the element process type and extended settings from the element 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. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def set_name_process_type(name: str, process_type: None) -> None: - """Sets the process type for an element name +def set_name_process_type(name: str, process_type: process_type) -> None: + """Sets the process type for an element name. Parameters: - name: name - process_type: process_type - - Returns: - None + name: The element name. + process_type: The process type. """ -def set_name_extended_settings(name: str, extended_settings: None) -> None: - """Sets the extended settings for an element name +def set_name_extended_settings(name: str, extended_settings: extended_settings) -> None: + """Sets the extended settings for an element name. Parameters: - name: name - extended_settings: extended_settings - - Returns: - None + name: The element name. + extended_settings: The extended settings. """ -def set_output_type(element_id_list: List[int], process_type: None) -> None: - """Sets the element output type +def set_output_type(element_id_list: List[ElementId], process_type: process_type) -> None: + """Sets the element output type. Parameters: - element_id_list: element_id_list - process_type: process_type - - Returns: - None + element_id_list: The element id list. + process_type: The process type. """ -def set_extended_settings(element_id_list: List[int], extended_settings: None) -> None: - """Sets the element extended settings +def set_extended_settings(element_id_list: List[ElementId], extended_settings: extended_settings) -> None: + """Sets the element extended settings. Parameters: - element_id_list: element_id_list - extended_settings: extended_settings - - Returns: - None + element_id_list: The element id list. + extended_settings: The extended settings. """ +def set_wall(element_id_list: List[ElementId]) -> None: + """Sets the element to wall. -def set_wall(element_ids: List[int]) -> None: - """set wall + Deprecated : + Use [set_framed_wall][attribute_controller.set_framed_wall] instead. Parameters: - element_ids: element_ids - - Returns: - None + element_id_list: The element id list. """ -def set_floor(element_ids: List[int]) -> None: - """set floor +def set_floor(element_id_list: List[ElementId]) -> None: + """Set floor. + Deprecated : + Use [set_framed_floor][attribute_controller.set_framed_floor] instead. + Parameters: - element_ids: element_ids - - Returns: - None + element_id_list: The element id list. """ -def set_opening(element_id_list: List[int]) -> None: - """Sets the element to opening +def set_opening(element_id_list: List[ElementId]) -> None: + """Sets the element to opening. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def set_fastening_attribute(element_id_list: List[int], value: str) -> None: - """Sets the element fastening attribute +def set_fastening_attribute(element_id_list: List[ElementId], value: str) -> None: + """Sets the element fastening attribute. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The fastening attribute value. """ -def set_element_material(element_id_list: List[int], material: int) -> None: - """Sets the element material +def set_element_material(element_id_list: List[ElementId], material: MaterialId) -> None: + """Sets the element material. Parameters: - element_id_list: element_id_list - material: material - - Returns: - None + element_id_list: The element id list. + material: The element material id. """ -def set_assembly_number(element_id_list: List[int], assembly_number: str) -> None: - """set assembly number +def set_assembly_number(element_id_list: List[ElementId], assembly_number: str) -> None: + """set assembly number. Parameters: - element_id_list: element_id_list - assembly_number: assembly_number - - Returns: - None + element_id_list: The element id list. + assembly_number: The assembly number. """ -def set_list_quantity(element_id_list: List[int], list_quantity: int) -> None: - """set list quantity +def set_list_quantity(element_id_list: List[ElementId], list_quantity: UnsignedInt) -> None: + """Set list quantity. Parameters: - element_id_list: element_id_list - list_quantity: list_quantity - - Returns: - None + element_id_list: The element id list. + list_quantity: The list quantity. """ -def set_layer_settings(element_id_list: List[int], layer_settings: None) -> None: - """set layer settings +def set_layer_settings(element_id_list: List[ElementId], layer_settings: layer_settings) -> None: + """Set layer settings. Parameters: - element_id_list: element_id_list - layer_settings: layer_settings - - Returns: - None + element_id_list: The element id list. + layer_settings: The layer settings. """ -def set_ignore_in_vba_calculation(elements: List[int], ignore: bool) -> None: - """Sets if the element should be ignored in VBA Calculation +def set_ignore_in_vba_calculation(element_id_list: List[ElementId], ignore: bool) -> None: + """Sets if the element should be ignored in VBA Calculation. Parameters: - elements: elements - ignore: ignore - - Returns: - None + element_id_list: The element id list. + ignore: True if the element should be ignored in VBA calculation, false otherwise. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """clear all errors. """ -def set_reference_wall_2dc(elements: List[int], _2dc_file_path: str) -> None: - """Applies a new 2dc reference wall to an element +def set_reference_wall_2dc(element_id_list: List[ElementId], _2dc_file_path: str) -> None: + """Applies a new 2dc reference wall to an element. Parameters: - elements: elements - _2dc_file_path: _2dc_file_path - - Returns: - None + element_id_list: The element id list. + _2dc_file_path: The 2dc file path. """ -def get_user_attribute_count() -> int: - """get user attribute count - +def get_user_attribute_count() -> UnsignedInt: + """Get user attribute count. + Returns: - int + The count of user attributes. """ -def set_standard_part(elements: List[int]) -> None: +def set_standard_part(element_id_list: List[ElementId]) -> None: """Sets covers (wall,opening or floor) to standard part. Parameters: - elements: elements - - Returns: - None + element_id_list: The element id list. """ -def set_solid_wall(elements: List[int]) -> None: +def set_solid_wall(element_id_list: List[ElementId]) -> None: """Sets elements to solid wall. Parameters: - elements: elements - - Returns: - None + element_id_list: The element id list. """ -def set_log_wall(elements: List[int]) -> None: +def set_log_wall(element_id_list: List[ElementId]) -> None: """Sets elements to log wall. Parameters: - elements: elements - - Returns: - None + element_id_list: The element id list. """ -def set_solid_floor(elements: List[int]) -> None: +def set_solid_floor(element_id_list: List[ElementId]) -> None: """Sets elements to solid floor. Parameters: - elements: elements - - Returns: - None + element_id_list: The element id list. """ -def set_roof(elements: List[int]) -> None: - """set roof +def set_roof(element_id_list: List[ElementId]) -> None: + """Set roof. - Parameters: - elements: elements + Deprecated : + Use [set_framed_roof][attribute_controller.set_framed_roof] instead. - Returns: - None + Parameters: + element_id_list: The element id list. """ -def set_solid_roof(elements: List[int]) -> None: +def set_solid_roof(element_id_list: List[ElementId]) -> None: """Sets elements to solid roof cover. Parameters: - elements: elements - - Returns: - None + element_id_list: The element id list. """ -def get_node_symbol(element: int) -> int: - """get node symbol +def get_node_symbol(element_id: ElementId) -> node_symbol: + """Get node symbol. Parameters: - element: element + element_id: The element id. Returns: - int + The node symbol of the element. """ -def set_node_symbol(elements: List[int], symbol: int) -> None: - """set node symbol +def set_node_symbol(element_id_list: List[ElementId], symbol: node_symbol) -> None: + """Set node symbol. Parameters: - elements: elements - symbol: symbol - - Returns: - None + element_id_list: The element id list. + symbol: The node symbol. """ def enable_attribute_display() -> None: - """enable attribute display - - Returns: - None + """Enable attribute display. """ def disable_attribute_display() -> None: - """disable attribute display - - Returns: - None + """Disable attribute display. """ def is_attribute_display_enabled() -> bool: - """is attribute display enabled + """Is attribute display enabled. Returns: - bool + True if attribute display is enabled, false otherwise. """ def update_auto_attribute() -> None: - """update auto attribute - - Returns: - None + """Update the auto attribute. """ -def set_additional_guid(elements: List[int], data_id: str, guid: str) -> None: - """set additional guid +def set_additional_guid(element_id_list: List[ElementId], data_id: str, guid: str) -> None: + """Set additional guid. Parameters: - elements: elements - data_id: data_id - guid: guid - - Returns: - None + element_id_list: The element id list. + data_id: The data id. + guid: The guid to set. """ - def add_item_to_group_list(item: str) -> None: - """add item to group list + """Add item to group list. Parameters: - item: item - - Returns: - None + item: The item to add in the group list. """ def add_item_to_subgroup_list(item: str) -> None: - """add item to subgroup list + """Add item to subgroup list. Parameters: - item: item - - Returns: - None + item: The item to add in the subgroup list. """ - def add_item_to_comment_list(item: str) -> None: - """add item to comment list - - Parameters: - item: item + """Add item to comment list. - Returns: - None + Args: + item: The item to add in the comment list. """ def add_item_to_sku_list(item: str) -> None: - """add item to sku list + """Add item to sku list. Parameters: - item: item - - Returns: - None + item: The item to add in the sku list. """ -def add_item_to_user_attribute_list(attribute_number: int, item: str) -> None: - """add item to user attribute list +def add_item_to_user_attribute_list(attribute_number: UserAttributeId, item: str) -> None: + """Add item to user attribute list. Parameters: - attribute_number: attribute_number - item: item - - Returns: - None + attribute_number: The attribute number. + item: The item to add in the user attribute list. """ -def set_container_number(elements: List[int], number: int) -> None: - """set container number +def set_container_number(element_id_list: List[ElementId], number: UnsignedInt) -> None: + """Set container number. Parameters: - elements: elements - number: number - - Returns: - None + element_id_list: The element id list. + number: The container number. """ def get_name_list_items() -> List[str]: - """get name list items + """Retrieve a list of name for all items Returns: - List[str] + A list of names for all items. """ def add_item_to_name_list(item: str) -> None: - """add item to name list + """Add item to name list. Parameters: - item: item - - Returns: - None + item: The item to add in the name list. """ def delete_item_from_comment_list(item: str) -> bool: - """delete item from comment list + """Delete item from comment list. Parameters: - item: item + item: The item to delete from the comment list. Returns: - bool + True if the item was successfully deleted, false otherwise. """ def delete_item_from_group_list(item: str) -> bool: - """delete item from group list + """Delete item from group list. Parameters: - item: item + item: The item to delete from the group list. Returns: - bool + True if the item was successfully deleted, false otherwise. """ def delete_item_from_sku_list(item: str) -> bool: - """delete item from sku list + """Delete item from sku list. Parameters: - item: item + item: The item to delete from the sku list. Returns: - bool + True if the item was successfully deleted, false otherwise. """ def delete_item_from_subgroup_list(item: str) -> bool: - """delete item from subgroup list + """Delete item from subgroup list. Parameters: - item: item + item: The item to delete from the subgroup list. Returns: - bool + True if the item was successfully deleted, false otherwise. """ -def delete_item_from_user_attribute_list(attribute_number: int, item: str) -> bool: - """delete item from user attribute list +def delete_item_from_user_attribute_list(attribute_number: UserAttributeId, item: str) -> bool: + """Delete item from user attribute list. Parameters: - attribute_number: attribute_number - item: item + attribute_number: The attribute number. + item: The item to delete from the user attribute list. Returns: - bool + 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 + """Set attribute display settings for 2d. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for 2d with layout. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for 2d without layout. Parameters: - settings: settings - - Returns: - None + settings: The display settings to apply. """ def set_attribute_display_settings_for_3d(settings: attribute_display_settings) -> None: - """set attribute display settings for 3d + """Set attribute display settings for 3d. Parameters: - settings: settings + settings: The display settings to apply. + """ - Returns: - None + +def set_attribute_display_settings_for_3d(settings: attribute_display_settings) -> None: + """Set attribute display settings for 3d. + + Parameters: + settings: The display settings to apply. """ def set_attribute_display_settings_for_container(settings: attribute_display_settings) -> None: - """set attribute display settings for container + """Set attribute display settings for container. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for export solid. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for framed wall axis. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for framed wall beam. Parameters: - settings: settings + settings: The display settings to apply. + """ - Returns: - None + +def set_attribute_display_settings_for_framed_wall_beam(settings: attribute_display_settings) -> None: + """Set attribute display settings for framed wall beam. + + Parameters: + 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 + """Set attribute display settings for framed wall opening. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for framed wall panel. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for log wall axis. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for log wall beam. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for log wall opening. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for log wall panel. Parameters: - settings: settings - - Returns: - None + settings: The display settings to apply. """ - def set_attribute_display_settings_for_machine(settings: attribute_display_settings) -> None: - """set attribute display settings for machine + """Set attribute display settings for machine. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for nesting element. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for nesting volume. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for solid wall axis. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for solid wall beam. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for solid wall opening. Parameters: - settings: settings - - Returns: - None + 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 + """Set attribute display settings for solid wall panel. Parameters: - settings: settings - - Returns: - None + settings: The display settings to apply. """ -def set_framed_floor(element_id_list: List[int]) -> None: - """Sets the elements to framed floor +def set_framed_floor(element_id_list: List[ElementId]) -> None: + """Sets the elements to framed floor. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def set_framed_roof(element_id_list: List[int]) -> None: - """Sets the elements to framed roof +def set_framed_roof(element_id_list: List[ElementId]) -> None: + """Sets the elements to framed roof. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def set_framed_wall(element_id_list: List[int]) -> None: - """Sets the element to framed wall +def set_framed_wall(element_id_list: List[ElementId]) -> None: + """Sets the element to framed wall. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def get_name_list_items_by_element_type(element_tpye: element_type) -> List[str]: - """get name list items by element type +def get_name_list_items_by_element_type(element_type: element_type) -> List[str]: + """Get name list items by element type. Parameters: - element_tpye: element_tpye + element_type: The element type to filter by. Returns: - List[str] + The list of names for the specified element type. """ -def get_name(element_id: int) -> str: - """Gets the element name +def get_name(element_id: ElementId) -> str: + """Gets the element name. Parameters: - element_id: element_id + element_id: The element id. Returns: - element name + The element name. """ -def get_group(element_id: int) -> str: - """Gets the element group +def get_group(element_id: ElementId) -> str: + """Gets the element group. Parameters: - element_id: element_id + element_id: The element id. Returns: - element group + The element group. """ -def get_subgroup(element_id: int) -> str: - """Gets the element subgroup +def get_subgroup(element_id: ElementId) -> str: + """Gets the element subgroup. Parameters: - element_id: element_id + element_id: The element id. Returns: - element subgroup + The element subgroup. """ -def get_comment(element_id: int) -> str: - """Gets the element comment +def get_comment(element_id: ElementId) -> str: + """Gets the element comment. Parameters: - element_id: element_id + element_id: The element id. Returns: - element comment + The element comment. """ -def get_user_attribute(element_id: int, number: int) -> str: - """Gets the element user attribute +def get_user_attribute(element_id: ElementId, number: UserAttributeId) -> str: + """Gets the element user attribute. Parameters: - element_id: element_id - number: number + element_id: The element id. + number: The user attribute number. Returns: - element user attribute + The element user attribute. """ -def get_sku(element_id: int) -> str: - """Gets the element SKU +def get_sku(element_id: ElementId) -> str: + """Gets the element SKU. Parameters: - element_id: element_id + element_id: The element id. Returns: - element SKU + The element SKU. """ -def get_production_number(element_id: int) -> int: - """Gets the element production number +def get_production_number(element_id: ElementId) -> UnsignedInt: + """Gets the element production number. Parameters: - element_id: element_id + element_id: The element id. Returns: - element production number + The element production number. """ -def get_part_number(element_id: int) -> int: - """Gets the element part number +def get_part_number(element_id: ElementId) -> UnsignedInt: + """Gets the element part number. Parameters: - element_id: element_id + element_id: The element id. Returns: - element part number + The element part number. """ -def get_additional_data(element_id: int, data_id: str) -> str: - """Gets the element additional data +def get_additional_data(element_id: ElementId, data_id: str) -> str: + """Gets the element additional data. Parameters: - element_id: element_id - data_id: data_id + element_id: The element id. + data_id: The data id. Returns: - element additional data + The element additional data. """ -def get_user_attribute_name(number: int) -> str: - """Gets the user attribute name +def get_user_attribute_name(number: UserAttributeId) -> str: + """Gets the user attribute name. Parameters: - number: number + number: The user attribute number. Returns: - user attribute name + The user attribute name. """ -def get_wall_situation(element_id: int) -> str: - """Gets the element wall situation +def get_wall_situation(element_id: ElementId) -> str: + """Gets the element wall situation. Parameters: - element_id: element_id + element_id: The element id. Returns: - element wall situation + The element wall situation. """ -def get_element_material_name(element_id: int) -> str: - """Gets the element material name +def get_element_material_name(element_id: ElementId) -> str: + """Gets the element material name. Parameters: - element_id: element_id + element_id: The element id. Returns: - element material name + The element material name. """ -def get_prefab_layer(element_id: int) -> str: - """Gets the element prefab layer +def get_prefab_layer(element_id: ElementId) -> str: + """Gets the element prefab layer. Parameters: - element_id: element_id + element_id: The element id. Returns: - element prefab layer + The element prefab layer. """ -def get_machine_calculation_set(element_id: int) -> str: - """Gets the element machine calculation set +def get_machine_calculation_set(element_id: ElementId) -> str: + """Gets the element machine calculation set. Parameters: - element_id: element_id + element_id: The element id. Returns: - element machine calculation set + The element machine calculation set. """ -def get_cutting_set(element_id: int) -> str: - """Gets the element cutting set +def get_cutting_set(element_id: ElementId) -> str: + """Gets the element cutting set. Parameters: - element_id: element_id + element_id: The element id. Returns: - element cutting set + The element cutting set. """ def get_name_process_type(name: str) -> process_type: - """Gets the process type for an element name + """Gets the process type for an element name. Parameters: - name: name + name: The element name. Returns: - process type + The process type. """ def get_name_extended_settings(name: str) -> extended_settings: - """Gets the extended settings for an element name + """Gets the extended settings for an element name. Parameters: - name: name + name: The element name. Returns: - extended settings + The extended settings. """ -def get_output_type(element_id: int) -> process_type: - """Gets the element output type +def get_output_type(element_id: ElementId) -> process_type: + """Gets the element output type. Parameters: - element_id: element_id + element_id: The element id. Returns: - element output type + The element output type. """ -def get_extended_settings(element_id: int) -> extended_settings: - """Gets the element extended settings +def get_extended_settings(element_id: ElementId) -> extended_settings: + """Gets the element extended settings. Parameters: - element_id: element_id + element_id: The element id. Returns: - element extended settings + The element extended settings. """ -def get_element_type(element_id: int) -> element_type: - """Gets the element type +def get_element_type(element_id: ElementId) -> element_type: + """Gets the element type. Parameters: - element_id: element_id + element_id: The element id. Returns: - element type + The element type. """ -def get_fastening_attribute(element_id: int) -> str: - """Get the element fastening attribute +def get_fastening_attribute(element_id: ElementId) -> str: + """Get the element fastening attribute. Parameters: - element_id: element_id + element_id: The element id. Returns: - element fastening attribute + The element fastening attribute. """ -def get_assembly_number(element_id: int) -> str: - """get assembly number +def get_assembly_number(element_id: ElementId) -> str: + """Get assembly number. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The assembly number. """ -def get_list_quantity(element_id: int) -> int: - """get list quantity +def get_list_quantity(element_id: ElementId) -> UnsignedInt: + """Get list quantity. Parameters: - element_id: element_id + element_id: The element id. Returns: - int + The list quantity. """ -def get_ignore_in_vba_calculation(element: int) -> bool: - """get ignore in vba calculation +def get_ignore_in_vba_calculation(element_id: ElementId) -> bool: + """Get ignore in vba calculation. Parameters: - element: element + element_id: The element id. Returns: - bool + True if the element is ignored in VBA calculation, false otherwise. """ -def get_standard_element_name(element_id: int) -> str: - """get standard element name +def get_standard_element_name(element_id: ElementId) -> str: + """Get standard element name. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The standard element name. """ -def get_steel_shape_name(element_id: int) -> str: - """get steel shape name +def get_steel_shape_name(element_id: ElementId) -> str: + """Get steel shape name. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The steel shape name. """ -def is_beam(element_id: int) -> bool: - """Tests if element is beam +def is_beam(element_id: ElementId) -> bool: + """Tests if element is beam. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element beam + True if the element is a beam, false otherwise. """ -def is_panel(element_id: int) -> bool: - """Tests if element is panel +def is_panel(element_id: ElementId) -> bool: + """Tests if element is panel. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element panel + True if the element is a panel, false otherwise. """ -def is_opening(element_id: int) -> bool: - """Tests if element is opening +def is_opening(element_id: ElementId) -> bool: + """Tests if element is opening. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element opening + True if the element is an opening, false otherwise. """ -def is_wall(element_id: int) -> bool: - """Tests if element is wall +def is_wall(element_id: ElementId) -> bool: + """Tests if element is wall. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element wall + True if the element is a wall, false otherwise. """ -def is_floor(element_id: int) -> bool: - """Tests if element is floor +def is_floor(element_id: ElementId) -> bool: + """Tests if element is floor. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element floor + True if the element is a floor, false otherwise. """ -def is_roof(element_id: int) -> bool: - """Tests if element is roof +def is_roof(element_id: ElementId) -> bool: + """Tests if element is roof. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element roof + True if the element is a roof, false otherwise. """ -def is_metal(element_id: int) -> bool: - """Tests if element is metal +def is_metal(element_id: ElementId) -> bool: + """Tests if element is metal. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element metal + True if the element is metal, false otherwise. """ -def is_export_solid(element_id: int) -> bool: - """Tests if element is export solid +def is_export_solid(element_id: ElementId) -> bool: + """Tests if element is export solid. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element export solid + True if the element is an export solid, false otherwise. """ -def is_container(element_id: int) -> bool: - """Tests if element is container +def is_container(element_id: ElementId) -> bool: + """Tests if element is container. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element container + True if the element is a container, false otherwise. """ -def is_connector_axis(element_id: int) -> bool: - """Tests if element is connector axis +def is_connector_axis(element_id: ElementId) -> bool: + """Tests if element is connector axis. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element connector axis + True if the element is a connector axis, false otherwise. """ -def is_drilling(element_id: int) -> bool: - """Tests if element is drilling +def is_drilling(element_id: ElementId) -> bool: + """Tests if element is drilling. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element drilling + True if the element is drilling, false otherwise. """ -def is_node(element_id: int) -> bool: - """Tests if element is node +def is_node(element_id: ElementId) -> bool: + """Tests if element is node. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element node + True if the element is a node, false otherwise. """ -def is_auxiliary(element_id: int) -> bool: - """Tests if element is auxiliary +def is_auxiliary(element_id: ElementId) -> bool: + """Tests if element is auxiliary. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element auxiliary + True if the element is auxiliary, false otherwise. """ -def is_roof_surface(element_id: int) -> bool: - """Tests if the element is roof surface +def is_roof_surface(element_id: ElementId) -> bool: + """Tests if the element is roof surface. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element roof surface + True if the element is a roof surface, false otherwise. """ -def is_caddy_object(element_id: int) -> bool: - """Tests if the element is caddy object +def is_caddy_object(element_id: ElementId) -> bool: + """Tests if the element is caddy object. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element caddy object + True if the element is a caddy object, false otherwise. """ -def is_envelope(element_id: int) -> bool: - """is envelope +def is_envelope(element_id: ElementId) -> bool: + """Tests if the element is an envelope. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is an envelope, false otherwise. """ -def is_architecture_wall_2dc(element: int) -> bool: - """Tests if the element has a 2dc reference wall +def is_architecture_wall_2dc(element_id: ElementId) -> bool: + """Tests if the element is a 2dc reference wall. Parameters: - element: element + element_id: The element id. Returns: - is architecturewall 2dc + True if the element is a 2dc reference wall, false otherwise. """ -def is_architecture_wall_xml(element: int) -> bool: - """Tests if the element has a xml reference wall +def is_architecture_wall_xml(element_id: ElementId) -> bool: + """Tests if the element is a xml reference wall. Parameters: - element: element + element_id: The element id. Returns: - is architecturewall xml + True if the element is a xml reference wall, false otherwise. """ -def is_surface(element_id: int) -> bool: - """Tests if the element is a Surface +def is_surface(element_id: ElementId) -> bool: + """Tests if the element is a Surface. Parameters: - element_id: element_id + element_id: The element id. Returns: - is Surface + True if the element is a Surface, false otherwise. """ -def is_line(element_id: int) -> bool: - """Tests if the element is a Line +def is_line(element_id: ElementId) -> bool: + """Tests if the element is a Line. Parameters: - element_id: element_id + element_id: The element id. Returns: - is Line + True if the element is a Line, false otherwise. """ -def get_auto_attribute(element_id: int, number: int) -> str: - """get auto attribute +def get_auto_attribute(element_id: ElementId, number: UnsignedInt) -> str: + """Get auto attribute. Parameters: - element_id: element_id - number: number + element_id: The element id. + number: The auto attribute number. Returns: - str + The auto attribute value. """ -def get_auto_attribute_name(number: int) -> str: - """get auto attribute name +def get_auto_attribute_name(number: UnsignedInt) -> str: + """Get auto attribute name. Parameters: - number: number + number: The auto attribute number. Returns: - str + The auto attribute name. """ -def is_framed_wall(element_id: int) -> bool: - """is framed wall +def is_framed_wall(element_id: ElementId) -> bool: + """Tests if the element is a framed wall. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a framed wall, false otherwise. """ -def is_solid_wall(element_id: int) -> bool: - """is solid wall +def is_solid_wall(element_id: ElementId) -> bool: + """Tests if the element is a solid wall. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a solid wall, false otherwise. """ -def is_log_wall(element_id: int) -> bool: - """is log wall +def is_log_wall(element_id: ElementId) -> bool: + """Tests if the element is a log wall. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a log wall, false otherwise. """ -def is_framed_floor(element_id: int) -> bool: - """is framed floor +def is_framed_floor(element_id: ElementId) -> bool: + """Tests if the element is a framed floor. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a framed floor, false otherwise. """ -def is_solid_floor(element_id: int) -> bool: - """is solid floor +def is_solid_floor(element_id: ElementId) -> bool: + """Tests if the element is a solid floor. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a solid floor, false otherwise. """ -def is_framed_roof(element_id: int) -> bool: - """is framed roof +def is_framed_roof(element_id: ElementId) -> bool: + """Tests if the element is a framed roof. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a framed roof, false otherwise. """ -def is_solid_roof(element_id: int) -> bool: - """is solid roof +def is_solid_roof(element_id: ElementId) -> bool: + """Tests if the element is a solid roof. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a solid roof, false otherwise. """ -def get_additional_guid(element_id: int, data_id: str) -> str: - """get additional guid +def get_additional_guid(element_id: ElementId, data_id: str) -> str: + """Get additional guid. Parameters: - element_id: element_id - data_id: data_id + element_id: The element id. + data_id: The data id. Returns: - str + The additional guid associated with the element and data id. """ -def get_prefab_layer_all_assigned(element_id: int) -> List[int]: - """get prefab layer all assigned +def get_prefab_layer_all_assigned(element_id: ElementId) -> List[int]: + """Get all assigned prefab layers. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of all assigned prefab layers for the element. """ -def get_prefab_layer_with_dimensions(element_id: int) -> List[int]: - """get prefab layer with dimensions +def get_prefab_layer_with_dimensions(element_id: ElementId) -> List[int]: + """Get prefab layer with dimensions. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of prefab layers with dimensions for the element. """ -def get_prefab_layer_without_dimensions(element_id: int) -> List[int]: - """get prefab layer without dimensions +def get_prefab_layer_without_dimensions(element_id: ElementId) -> List[int]: + """Get prefab layer without dimensions. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of prefab layers without dimensions for the element. """ -def is_nesting_parent(element_id: int) -> bool: - """is nesting parent +def is_nesting_parent(element_id: ElementId) -> bool: + """Tests if the element is a nesting parent. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a nesting parent, false otherwise. """ -def is_nesting_raw_part(element_id: int) -> bool: - """is nesting raw part +def is_nesting_raw_part(element_id: ElementId) -> bool: + """Tests if the element is a nesting raw part. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a nesting raw part, false otherwise. """ -def get_container_number(element_id: int) -> int: - """get container number +def get_container_number(element_id: ElementId) -> UnsignedInt: + """Get container number. Parameters: - element_id: element_id + element_id: The element id. Returns: - int + The container number associated with the element. """ -def get_container_number_with_prefix(element_id: int) -> str: - """get container number with prefix +def get_container_number_with_prefix(element_id: ElementId) -> str: + """Get container number with prefix. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The container number with prefix associated with the element. """ def get_group_list_items() -> List[str]: - """get group list items + """Get group list items. Returns: - List[str] + The list of group list items. """ def get_subgroup_list_items() -> List[str]: - """get subgroup list items + """Get subgroup list items. Returns: - List[str] + The list of subgroup list items. """ def get_comment_list_items() -> List[str]: - """get comment list items + """Get comment list items. Returns: - List[str] + The list of comment list items. """ def get_sku_list_items() -> List[str]: - """get sku list items + """Get sku list items. Returns: - List[str] + The list of sku list items. """ -def get_user_attribute_list_items(element_id: int) -> List[str]: - """get user attribute list items +def get_user_attribute_list_items(element_id: ElementId) -> List[str]: + """Get user attribute list items. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[str] + The list of user attribute list items. """ -def is_circular_mep(element_id: int) -> bool: - """is circular mep +def is_circular_mep(element_id: ElementId) -> bool: + """Test if element is circular mep. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a circular mep, false otherwise. """ -def is_rectangular_mep(element_id: int) -> bool: - """is rectangular mep +def is_rectangular_mep(element_id: ElementId) -> bool: + """Test if element is rectangular mep. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a rectangular mep, false otherwise. """ - -def get_machine_calculation_state(element_id: int) -> str: - """get machine calculation state +def get_machine_calculation_state(element_id: ElementId) -> str: + """Get machine calculation state. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The machine calculation state of the element. """ -def get_machine_calculation_set_machine_type(element_id: int) -> str: - """get machine calculation set machine type +def get_machine_calculation_set_machine_type(element_id: ElementId) -> str: + """Get machine calculation set machine type. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The machine calculation set machine type of the element. """ - -def is_btl_processing_group(element_id: int) -> bool: - """is btl processing group +def is_btl_processing_group(element_id: ElementId) -> bool: + """Test if element is btl processing group. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is a btl processing group, false otherwise. """ - -def is_hundegger_processing_group(element_id: int) -> bool: - """is hundegger processing group +def is_hundegger_processing_group(element_id: ElementId) -> bool: + """Test if element is hundegger processing group. Parameters: - element_id: element_id + element_id: The element id. Returns: - 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) + """Get the element grouping type (group, subgroup). Returns: - 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) + """Set the element grouping type (group, subgroup). Parameters: - element_grouping_type: element_grouping_type - - Returns: - None + element_grouping_type: The element grouping type to set. """ -def get_associated_nesting_name(element_id: int) -> str: - """get associated nesting name +def get_associated_nesting_name(element_id: ElementId) -> str: + """Get associated nesting name Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The associated nesting name. """ -def get_associated_nesting_number(element_id: int) -> str: - """get associated nesting number +def get_associated_nesting_number(element_id: ElementId) -> str: + """Get associated nesting number. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The associated nesting number. """ def get_attribute_display_settings_for_2d() -> attribute_display_settings: - """get attribute display settings for 2d + """Get attribute display settings for 2d. Returns: - 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 + """Get attribute display settings for 2d with layout. Returns: - attribute_display_settings + 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 + """Get attribute display settings for 2d without layout. Returns: - attribute_display_settings + The attribute display settings for 2d without layout. """ def get_attribute_display_settings_for_3d() -> attribute_display_settings: - """get attribute display settings for 3d + """Get attribute display settings for 3d. Returns: - 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 + """Get attribute display settings for container. Returns: - 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 + """Get attribute display settings for export solid. Returns: - attribute_display_settings + 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 + """Get attribute display settings for framed wall axis. Returns: - attribute_display_settings + 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 + """Get attribute display settings for framed wall beam. Returns: - attribute_display_settings + 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 + """Get attribute display settings for framed wall opening. Returns: - attribute_display_settings + 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 + """Get attribute display settings for framed wall panel. Returns: - attribute_display_settings + 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 + """Get attribute display settings for log wall axis. Returns: - attribute_display_settings + 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 + """Get attribute display settings for log wall beam. Returns: - attribute_display_settings + 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 + """Get attribute display settings for log wall opening. Returns: - attribute_display_settings + 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 + """Get attribute display settings for log wall panel. Returns: - attribute_display_settings + The attribute display settings for log wall panel. """ def get_attribute_display_settings_for_machine() -> attribute_display_settings: - """get attribute display settings for machine + """Get attribute display settings for machine. Returns: - 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 + """Get attribute display settings for nesting element. Returns: - attribute_display_settings + 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 + """Get attribute display settings for nesting volume. Returns: - attribute_display_settings + 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 + """Get attribute display settings for solid wall axis. Returns: - attribute_display_settings + 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 + """Get attribute display settings for solid wall beam. Returns: - attribute_display_settings + 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 + """Get attribute display settings for solid wall opening. Returns: - attribute_display_settings + 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 + """Get attribute display settings for solid wall panel. Returns: - attribute_display_settings + The attribute display settings for solid wall panel. """ -def is_processing(element_id: int) -> bool: - """is processing +def is_processing(element_id: ElementId) -> bool: + """Tests if element is processing. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is processing, false otherwise. """ -def delete_user_attribute(number: int) -> bool: +def delete_user_attribute(number: UserAttributeId) -> bool: """Delete user attribute from attribute list. The attribute is only deleted when the attribute is not used. Parameters: - number: number + number: The attribute number. Returns: - bool deletion successfully + True if the attribute was successfully deleted, false otherwise. """ -def is_attribute_visible_in_modify_window(number: int) -> bool: - """is attribute visible in modify window +def is_attribute_visible_in_modify_window(number: UnsignedInt) -> bool: + """Test if attribute is visible in modify window. Parameters: - number: number + number: The attribute number. Returns: - bool + True if the attribute is visible in the modify window, false otherwise. """ -def set_attribute_visibility_in_modify_window(number: int, visibility: bool) -> None: - """set attribute visibility in modify window +def set_attribute_visibility_in_modify_window(number: UnsignedInt, visibility: bool) -> None: + """Set attribute visibility in modify window. Parameters: - number: number - visibility: visibility - - Returns: - None + number: The attribute number. + visibility: The visibility state. """ -def set_cutting_set(element_id_list: List[int], cutting_set_name: str) -> bool: - """set cutting set +def set_cutting_set(element_id_list: List[ElementId], cutting_set_name: str) -> bool: + """Set cutting set. Parameters: - element_id_list: element_id_list - cutting_set_name: cutting_set_name + element_id_list: The list of element ids. + cutting_set_name: The name of the cutting set. Returns: - bool + True if the cutting set was successfully set, false otherwise. """ -def get_standard_element_material_id(element_id: int) ->int: - """get standard element material id +def get_standard_element_material_id(element_id: ElementId) -> int: + """Get standard element material id. Parameters: - element_id: element_id + element_id: The element id. Returns: - int + The standard element material id. """ \ No newline at end of file From 26ee8af286096fb126540f5064f743022393df90 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 12:04:04 +0200 Subject: [PATCH 09/30] [API-519] Added ifc_predefined_type class in the doc --- docs/documentation/ifc_predefined_type.md | 6 ++++++ mkdocs.yml | 1 + 2 files changed, 7 insertions(+) create mode 100644 docs/documentation/ifc_predefined_type.md diff --git a/docs/documentation/ifc_predefined_type.md b/docs/documentation/ifc_predefined_type.md new file mode 100644 index 0000000..e0c0775 --- /dev/null +++ b/docs/documentation/ifc_predefined_type.md @@ -0,0 +1,6 @@ +# ifc_predefined_type + +::: cadwork.ifc_predefined_type + rendering: + show_root_heading: false + show_source: true diff --git a/mkdocs.yml b/mkdocs.yml index 9e32aed..5af63a9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -50,6 +50,7 @@ nav: - BREP data: documentation/brep_data.md - IFC: - IFC2x3 Element Type: documentation/ifc_2x3_element_type.md + - IFC Predefined Type: documentation/ifc_predefined_type.md - IFC Options: documentation/ifc_options.md - Camera: documentation/camera_data.md - Layer Settings: documentation/layer_settings.md From 69cb44f7f1da27bdd0e2146993f3e37456510b10 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 12:04:47 +0200 Subject: [PATCH 10/30] [API-519] Improved the bim controller documentation --- src/bim_controller/__init__.pyi | 248 ++++++++++++++------------------ 1 file changed, 110 insertions(+), 138 deletions(-) diff --git a/src/bim_controller/__init__.pyi b/src/bim_controller/__init__.pyi index 62cdd70..3a2f864 100644 --- a/src/bim_controller/__init__.pyi +++ b/src/bim_controller/__init__.pyi @@ -2,23 +2,13 @@ from typing import List from cadwork.ifc_2x3_element_type import ifc_2x3_element_type from cadwork.ifc_options import ifc_options from cadwork.ifc_predefined_type import ifc_predefined_type +from cadwork.api_types import * - -def get_last_error(a0: int) -> str: - """get last error - - Parameters: - a0: a0 - - Returns: - str - """ - -def get_ifc_guid(element_id: int) -> str: - """get ifc guid +def get_ifc_guid(element_id: ElementId) -> str: + """Get the IFC GUID of an element. Parameters: - element_id: element_id + element_id: The element id. Examples: >>> import element_controller as ec @@ -30,14 +20,14 @@ def get_ifc_guid(element_id: int) -> str: >>> print(f"IFC GUID: {ifc_guid}") Returns: - str + A string representing the IFC GUID. """ -def get_ifc2x3_element_type(element_id: int) -> ifc_2x3_element_type: - """get ifc2x3 element type +def get_ifc2x3_element_type(element_id: ElementId) -> ifc_2x3_element_type: + """Get ifc2x3 element type. Parameters: - element_id: element_id + element_id: The element id. Examples: >>> import element_controller as ec @@ -49,17 +39,17 @@ def get_ifc2x3_element_type(element_id: int) -> ifc_2x3_element_type: >>> ifc_type = bc.get_ifc2x3_element_type(element) Returns: - ifc_2x3_element_type + The ifc_2x3_element_type of the element. """ -def set_ifc2x3_element_type(element_i_ds: List[int], ifc_type: ifc_2x3_element_type) -> None: - """set ifc2x3 element type +def set_ifc2x3_element_type(element_id_list: List[ElementId], ifc_type: ifc_2x3_element_type) -> None: + """Set ifc2x3 element type. Parameters: - element_i_ds: element_i_ds - ifc_type: element_type - + 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 @@ -69,16 +59,13 @@ def set_ifc2x3_element_type(element_i_ds: List[int], ifc_type: ifc_2x3_element_t >>> ifc_entity_type = cadwork.ifc_2x3_element_type() >>> ifc_entity_type.set_ifc_member() >>> bc.set_ifc2x3_element_type(selected_elements, ifc_entity_type) - - Returns: - None """ def import_ifc_as_graphical_object(file_path: str) -> bool: - """import ifc as graphical object + """Imports ifc as graphical object. Parameters: - file_path: file_path + file_path: The path to the IFC file. Examples: >>> import bim_controller as bc @@ -89,14 +76,14 @@ def import_ifc_as_graphical_object(file_path: str) -> bool: >>> print("IFC imported as graphical object successfully") Returns: - bool + True if the import was successful, false otherwise. """ def import_bcf(file_path: str) -> bool: - """import bcf + """Imports a BCF file. Parameters: - file_path: file_path + file_path: The path to the BCF file. Examples: >>> import bim_controller as bc @@ -107,14 +94,14 @@ def import_bcf(file_path: str) -> bool: >>> print("BCF file imported successfully") Returns: - bool + True if the import was successful, false otherwise. """ def export_bcf(file_path: str) -> bool: - """export bcf + """Exports a BCF file. Parameters: - file_path: file_path + file_path: The path where the BCF file will be exported. Examples: >>> import bim_controller as bc @@ -125,15 +112,15 @@ def export_bcf(file_path: str) -> bool: >>> print("BCF file exported successfully") Returns: - bool + True if the export was successful, false otherwise. """ -def export_ifc(element_i_ds: List[int], file_path: str) -> bool: - """export ifc +def export_ifc(element_id_list: List[ElementId], file_path: str) -> bool: + """Export IFC file. Parameters: - element_i_ds: element_i_ds - file_path: file_path + element_id_list: The list of element ids. + file_path: The path where the IFC file will be exported. Examples: >>> import element_controller as ec @@ -146,26 +133,26 @@ def export_ifc(element_i_ds: List[int], file_path: str) -> bool: >>> print("IFC file exported successfully") Returns: - bool + True if the export was successful, false otherwise. """ -def import_ifc_return_exchange_objects(file_path: str) -> List[int]: - """imports an IFC File and returns the ids of the Exchange Objects +def import_ifc_return_exchange_objects(file_path: str) -> List[ElementId]: + """Imports an IFC File and returns the ids of the Exchange Objects. Parameters: - file_path: file_path + file_path: The path to the IFC file. Returns: - List[int] + The ids of the exchange objects. """ def set_storey_height(building: str, storey: str, height: float) -> None: - """set storey height + """Set storey height. Parameters: - building: building - storey: storey - height: height + building: The name of the building. + storey: The name of the storey. + height: The height of the storey. Examples: >>> import bim_controller as bc @@ -174,101 +161,92 @@ def set_storey_height(building: str, storey: str, height: float) -> None: >>> storey_name = "Ground Floor" >>> height_millimeters = 3_500 >>> bc.set_storey_height(building_name, storey_name, height_millimeters) - - Returns: - None """ -def convert_exchange_objects(exchange_objects: List[int]) -> List[int]: - """converts a list of Exchange Objects to Cadwork Elements +def convert_exchange_objects(exchange_objects: List[ElementId]) -> List[ElementId]: + """Converts a list of Exchange Objects to Cadwork Elements. Parameters: - exchange_objects: exchange_objects + exchange_objects: A list of Exchange Object id to convert. Returns: - List[int] + The list of Cadwork Element ids. """ -def export_ifc2x3_silently(element_i_ds: List[int], file_path: str) -> bool: - """export ifc2x3 silently +def export_ifc2x3_silently(element_id_list: List[ElementId], file_path: str) -> bool: + """Export IFC2x3 silently. Parameters: - element_i_ds: element_i_ds - file_path: file_path + element_id_list: The list of element ids. + file_path: The path where the IFC file will be exported. Returns: - bool + True if the export was successful, false otherwise. """ -def export_ifc4_silently(element_i_ds: List[int], file_path: str) -> bool: - """export ifc4 silently +def export_ifc4_silently(element_id_list: List[ElementId], file_path: str) -> bool: + """Exports IFC4 silently. Parameters: - element_i_ds: element_i_ds - file_path: file_path + element_id_list: The list of element ids. + file_path: The path where the IFC file will be exported. Returns: - bool + True if the export was successful, false otherwise. """ -def export_ifc2x3_silently_with_options(element_i_ds: List[int], file_path: str, options: ifc_options) -> bool: - """export ifc2x3 silently with options +def export_ifc2x3_silently_with_options(element_id_list: List[ElementId], file_path: str, options: ifc_options) -> bool: + """Exports IFC2x3 silently with options. Parameters: - element_i_ds: element_i_ds - file_path: file_path - options: options + element_id_list: The list of element ids. + file_path: The path where the IFC file will be exported. + options: The export options. Returns: - bool + True if the export was successful, false otherwise. """ -def export_ifc4_silently_with_options(element_i_ds: List[int], file_path: str, options: ifc_options) -> bool: - """export ifc4 silently with options +def export_ifc4_silently_with_options(element_id_list: List[ElementId], file_path: str, options: ifc_options) -> bool: + """Exports IFC4 silently with options. Parameters: - element_i_ds: element_i_ds - file_path: file_path - options: options + element_id_list: The list of element ids. + file_path: The path where the IFC file will be exported. + options: The export options. Returns: - bool + True if the export was successful, false otherwise. """ -def update_bmt_structure_created_elements(element_i_ds: List[int]) -> None: +def update_bmt_structure_created_elements(element_id_list: List[ElementId]) -> None: """This function takes the specified elements and inserts them into the BMT structure and adds them to the active building and storey. Parameters: - element_i_ds: element_i_ds - - Returns: - None + element_id_list: The list of element ids to be updated in the BMT structure. """ -def update_bmt_structure_building_storey(element_i_ds: List[int]) -> None: +def update_bmt_structure_building_storey(element_id_list: List[ElementId]) -> None: """This function takes the specified elements and inserts them into the BMT structure and adds them to the assigned Building and Storey. Parameters: - element_i_ds: element_i_ds - - Returns: - None + element_id_list: The list of element ids to be updated in the BMT structure. """ def get_ifc_options() -> ifc_options: - """Get the IfcOptions with the settings used in the document + """Get the IfcOptions with the settings used in the document. Returns: - ifc_options + The IfcOptions object containing the current settings. """ -def set_building_and_storey(element_id_list: List[int], building: str, storey: str) -> None: - """set building and storey +def set_building_and_storey(element_id_list: List[ElementId], building: str, storey: str) -> None: + """Set building and storey. Parameters: - element_id_list: element_id_list - building: building - storey: storey + element_id_list: The list of element ids. + building: The building name. + storey: The storey name. Examples: >>> import element_controller as ec @@ -278,119 +256,116 @@ def set_building_and_storey(element_id_list: List[int], building: str, storey: s >>> building_name = "Building A" >>> storey_name = "Ground Floor" >>> bc.set_building_and_storey(selected_elements, building_name, storey_name) - - Returns: - None """ -def get_building(element: int) -> str: - """get building +def get_building(element_id: ElementId) -> str: + """Get building name for a given element. Parameters: - element: element + element_id: The element id. Returns: - str + The name of the building. """ -def get_storey(element: int) -> str: - """get storey +def get_storey(element_id: ElementId) -> str: + """Get storey name for a given element. Parameters: - element: element + element_id: The element id. Returns: - str + The name of the storey. """ def get_storey_height(building: str, storey: str) -> float: - """get storey height + """Get storey height for a given building and storey. Parameters: - building: building - storey: storey + building: The building name. + storey: The storey name. Returns: - float + The height of the storey. """ def get_ifc2x3_element_type_string(entity_type: ifc_2x3_element_type) -> str: - """get ifc2x3 element type string + """Get IFC2x3 element type string. Parameters: - entity_type: entity_type + entity_type: The entity type. Returns: - 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 + """Get IFC2x3 element type display string. Parameters: - entity_type: entity_type + entity_type: The entity type. Returns: - str + The display string representation of the IFC2x3 element type. """ def get_all_buildings() -> List[str]: - """get all buildings + """Get all buildings. Returns: - List[str] + A list of all building. """ def get_all_storeys(building: str) -> List[str]: - """get all storeys + """Get all storeys. Parameters: - building: building + building: The building name. Returns: - List[str] + A list of all storeys in the building. """ -def get_element_id_from_base64_ifc_guid(base_64_ifc_guid: str) -> int: - """get element id from base64 ifc guid +def get_element_id_from_base64_ifc_guid(base_64_ifc_guid: str) -> ElementId: + """Get element id from base64 ifc guid. Parameters: - base_64_ifc_guid: base_64_ifc_guid + base_64_ifc_guid: The base64 IFC GUID. Returns: - int + The element id corresponding to the base64 IFC GUID. """ -def get_ifc_base64_guid(element_id: int) -> str: - """Get IFC base64 Guid from element ID +def get_ifc_base64_guid(element_id: ElementId) -> str: + """Get IFC base64 Guid from element id. Parameters: - element_id: element_id + element_id: The element id. Returns: The IFC GUID in base64 string format ("28kif20KPEuBjk2m1N3ep$"). """ -def get_ifc_predefined_type(element_id: int) -> 'ifc_predefined_type': +def get_ifc_predefined_type(element_id: ElementId) -> 'ifc_predefined_type': """Get the IfcPredefinedType of an element. Parameters: - element_id: element_id + element_id: The element id. Returns: - IfcPredefinedType Wrapper + The IfcPredefinedType of the element. """ -def set_ifc_predefined_type(element_i_ds: List[int], 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 +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. Parameters: - element_i_ds: element_i_ds - predefined_type: predefined_type + element_id_list: The list of element ids. + predefined_type: The predefined type to set. Examples: >>> import element_controller as ec @@ -401,7 +376,4 @@ def set_ifc_predefined_type(element_i_ds: List[int], predefined_type: ifc_predef >>> predefined_type = cadwork.ifc_predefined_type() >>> predefined_type.set_member() >>> bc.set_ifc_predefined_type(selected_elements, predefined_type) - - Returns: - None """ From ff530c25373b198c8250ba239d8036e8e61fc5d0 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 14:14:44 +0200 Subject: [PATCH 11/30] [API-519] Added vba_catalog_item_type class in the doc --- docs/documentation/enums.md | 25 +++++++++----- src/cadwork/vba_catalog_item_type.pyi | 50 +++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 src/cadwork/vba_catalog_item_type.pyi diff --git a/docs/documentation/enums.md b/docs/documentation/enums.md index 4d0b46f..614bb71 100644 --- a/docs/documentation/enums.md +++ b/docs/documentation/enums.md @@ -77,20 +77,27 @@ ### Dimenson base format ::: cadwork.dimension_base_format -rendering: -show_root_heading: false -show_source: true + rendering: + show_root_heading: false + show_source: true ### DXF export version ::: cadwork.dxf_export_version -rendering: -show_root_heading: false -show_source: true + rendering: + show_root_heading: false + show_source: true ### DXF layer format type ::: cadwork.dxf_layer_format_type -rendering: -show_root_heading: false -show_source: true + rendering: + show_root_heading: false + show_source: true + +## Vba catalog + +::: cadwork.vba_catalog_item_type + rendering: + show_root_heading: false + show_source: true diff --git a/src/cadwork/vba_catalog_item_type.pyi b/src/cadwork/vba_catalog_item_type.pyi new file mode 100644 index 0000000..7728235 --- /dev/null +++ b/src/cadwork/vba_catalog_item_type.pyi @@ -0,0 +1,50 @@ +from enum import IntEnum, unique + + +@unique +class vba_catalog_item_type(IntEnum): + """ Enumeration for vba item types. + + Examples: + >>> cadwork.vba_catalog_item_type.nut + nut + """ + null = 0 + """""" + nut = 1 + """""" + washer = 2 + """""" + wpecial_ring = 3 + """""" + square_washer = 4 + """""" + wooden_plug = 5 + """""" + bolt_with_head = 10001 + """""" + bolt_without_head = 10002 + """""" + lag_bolt = 10003 + """""" + bolt_peg = 10004 + """""" + normal_screw = 10005 + """""" + wooden_dowl = 10006 + """""" + bolt_anchor = 10007 + """""" + bolt_with_mushroom_head = 10008 + """""" + bolt_with_conical_head = 10009 + """""" + bolt_with_head_and_washer = 10010 + """""" + hanger_bolt = 10011 + """""" + connection_screw = 10012 + """""" + + def __int__(self) -> int: + return self.value From 0bdb312fd765880c852bb7584eff1bcfd013ecdf Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 14:14:59 +0200 Subject: [PATCH 12/30] [API-519] Improved the connector axis controller documentation --- src/connector_axis_controller/__init__.pyi | 467 +++++++++------------ 1 file changed, 204 insertions(+), 263 deletions(-) diff --git a/src/connector_axis_controller/__init__.pyi b/src/connector_axis_controller/__init__.pyi index 0695469..ab614af 100644 --- a/src/connector_axis_controller/__init__.pyi +++ b/src/connector_axis_controller/__init__.pyi @@ -1,242 +1,202 @@ from typing import List from cadwork.point_3d import point_3d +from cadwork.api_types import * +from cadwork.vba_catalog_item_type import vba_catalog_item_type - -def get_last_error(error_code: int) -> str: - """get last error - - Parameters: - error_code: error_code - - Returns: - str - """ - - -def create_standard_connector(axis_name: str, point1: point_3d, point2: point_3d) -> int: +def create_standard_connector(axis_name: str, point1: point_3d, point2: point_3d) -> ElementId: """Creates a standard connector axis between two points. Parameters: - axis_name: axis_name - point1: point1 - point2: point2 + axis_name: Name of the standard connector axis. + point1: The first point defining the connector axis. + point2: The second point defining the connector axis. Returns: - int + The element id of the created standard connector axis. """ -def set_bolt_length(axis_id: int, length: float) -> None: - """Sets the Bolt Length +def set_bolt_length(axis_id: ElementId, length: float) -> None: + """Sets the Bolt Length. Parameters: - axis_id: axis_id - length: length - - Returns: - None + axis_id: The id of the axis. + length: The bolt length. """ -def set_bolt_length_automatic(axis_id: int, length_automatic: bool) -> None: - """Sets the Bolt Length Automatic +def set_bolt_length_automatic(axis_id: ElementId, length_automatic: bool) -> None: + """Sets the Bolt Length Automatic. Parameters: - axis_id: axis_id - length_automatic: length_automatic - - Returns: - None + axis_id: The id of the axis. + length_automatic: True if the bolt length should be automatic, false otherwise. """ -def set_diameter(axis_id: int, diameter: float) -> None: - """Sets the Drilling Diameter for all Sections +def set_diameter(axis_id: ElementId, diameter: float) -> None: + """Sets the Drilling Diameter for all Sections. Parameters: - axis_id: axis_id - diameter: diameter - - Returns: - None + axis_id: The id of the axis. + diameter: The drilling diameter to set for all sections. """ -def set_section_diameter(axis_id: int, section_nr: int, diameter: float) -> None: - """Sets the Drilling Diameter for a specific Sections +def set_section_diameter(axis_id: ElementId, section_index: UnsignedInt, diameter: float) -> None: + """Sets the Drilling Diameter for a specific Sections. Parameters: - axis_id: axis_id - section_nr: section_nr - diameter: diameter - - Returns: - None + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) + diameter: The drilling diameter to set for the specific section. """ -def check_axis(axis_id: int) -> bool: +def check_axis(axis_id: ElementId) -> bool: """Returns if the axis is valid. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - bool + True if the axis is valid, false otherwise. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clear all errors. """ -def update_axis_cutting_ability(axis_i_ds: List[int]) -> None: - """updates the Connection Config (CuttingAbility) of Axis/VBAs +def update_axis_cutting_ability(axis_id_list: List[ElementId]) -> None: + """Updates the Connection Config (CuttingAbility) of Axis/VBAs. Parameters: - axis_i_ds: axis_i_ds - - Returns: - None + axis_id_list: The axis id list. """ -def set_bolt_item(axis_id: int, item_guid: str) -> None: - """Sets the Bolt Item +def set_bolt_item(axis_id: ElementId, item_guid: str) -> None: + """Sets the Bolt Item. Parameters: - axis_id: axis_id - item_guid: item_guid - - Returns: - None + axis_id: The id of the axis. + item_guid: The bolt item guid to set. """ -def create_blank_connector(diameter: float, start_point: point_3d, end_point: point_3d) -> int: - """create blank connector +def create_blank_connector(diameter: float, start_point: point_3d, end_point: point_3d) -> ElementId: + """Creates a blank connector between two points. Parameters: - diameter: diameter - start_point: start_point - end_point: end_point + diameter: The diameter of the connector. + start_point: The start point of the connector. + end_point: The end point of the connector. Returns: - int + The element id of the created blank connector. """ def import_from_file(file_path: str) -> None: - """import from file + """Import from file. Parameters: - file_path: file_path - - Returns: - None + file_path: The path to the file to import. """ def start_configuration_dialog() -> None: """Starts the ConnectorAxis configuration dialog. - - Returns: - None """ -def get_item_guid_by_name(name: str, item_type: int) -> str: - """get item guid by name +def get_item_guid_by_name(name: str, item_type: vba_catalog_item_type) -> str: + """Get item guid by name. Parameters: - name: name - item_type: item_type + name: The name of the item. + item_type: The type of the item. Returns: - str + The guid of the item. """ -def get_bolt_length(axis_id: int) -> float: - """Gets the Bolt Length +def get_bolt_length(axis_id: ElementId) -> float: + """Gets the Bolt Length. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - float + The bolt length. """ -def get_bolt_over_length(axis_id: int) -> float: - """Gets the Bolt OverLength +def get_bolt_over_length(axis_id: ElementId) -> float: + """Gets the Bolt OverLength. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - float + The bolt over length. """ -def set_bolt_over_length(axis_id: int, over_length: float) -> None: - """Sets the Bolt OverLength +def set_bolt_over_length(axis_id: ElementId, over_length: float) -> None: + """Sets the Bolt OverLength. Parameters: - axis_id: axis_id - over_length: over_length - - Returns: - None + axis_id: The id of the axis. + over_length: The bolt over length. """ -def get_bolt_length_automatic(axis_id: int) -> bool: - """Returns if Bolt Length Automatic is set +def get_bolt_length_automatic(axis_id: ElementId) -> bool: + """Returns if Bolt Length Automatic is set. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - bool + True if the bolt length is automatic, false otherwise. """ -def get_bolt_item_guid(axis_id: int) -> str: - """Gets the Guid of the Bolt Item +def get_bolt_item_guid(axis_id: ElementId) -> str: + """Gets the Guid of the Bolt Item. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - str + The guid of the bolt item. """ -def get_section_diameter(axis_id: int, section_nr: int) -> float: - """Gets the Drilling Diameter of a specific Sections +def get_section_diameter(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Gets the Drilling Diameter of a specific Sections. Parameters: - axis_id: axis_id - section_nr: section_nr + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - float + The drilling diameter of the specified section. """ -def get_axis_items_guids(axis_id: int) -> List[str]: +def get_axis_items_guids(axis_id: ElementId) -> List[str]: """Returns a list of GUIDs of all axis items. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - List[str] + The list of GUIDs of all axis items. """ @@ -244,10 +204,10 @@ def get_axis_item_name(guid: str) -> str: """Returns the name of an axis item. Parameters: - guid: guid + guid: The guid of the axis item. Returns: - str + The name of the axis item. """ @@ -255,10 +215,10 @@ def get_axis_item_material(guid: str) -> str: """Returns the material of an axis item. Parameters: - guid: guid + guid: The guid of the axis item. Returns: - str + The material of the axis item. """ @@ -266,10 +226,10 @@ def get_axis_item_norm(guid: str) -> str: """Returns the norm of an axis item. Parameters: - guid: guid + guid: The guid of the axis item. Returns: - str + The norm of the axis item. """ @@ -277,22 +237,22 @@ def get_axis_item_strength_category(guid: str) -> str: """Returns the strength category of an axis item. Parameters: - guid: guid + guid: The guid of the axis item. Returns: - str + The strength category of the axis item. """ -def get_axis_item_user_field(guid: str, user_item_nr: int) -> str: +def get_axis_item_user_field(guid: str, user_item_number: int) -> str: """Returns an userfield value of an axis item. Parameters: - guid: guid - user_item_nr: user_item_nr + guid: The guid of the axis item. + user_item_number: The user item number. Returns: - str + The user field value. """ @@ -300,305 +260,286 @@ def get_axis_item_order_number(guid: str) -> str: """Returns the strength category of an axis item. Parameters: - guid: guid + guid: The guid of the axis item. Returns: - str + The strength category of the axis item. """ -def get_bolt_order_number(axis_id: int) -> str: +def get_bolt_order_number(axis_id: ElementId) -> str: """Returns the ordernumber of a bolt item. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - str + The order number of the bolt item. """ -def get_section_count(axis_id: int) -> int: +def get_section_count(axis_id: ElementId) -> int: """Returns the number of sections. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - int + The number of sections of the axis. """ -def get_section_material_name(axis_id: int, section_nr: int) -> str: +def get_section_material_name(axis_id: ElementId, section_index: UnsignedInt) -> str: """Returns material of a section contact element. Parameters: - axis_id: axis_id - section_nr: section_nr + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - str + The material of the section contact element. """ -def get_section_contact_element(axis_id: float, section_nr: int) -> int: - """get section contact element +def get_section_contact_element(axis_id: float, section_index: UnsignedInt) -> ElementId: + """Gets the section contact element. Parameters: - axis_id: axis_id - section_nr: section_nr + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - int + The element id of the section contact element. """ -def get_bolt_diameter(axis_id: int) -> float: - """get bolt diameter +def get_bolt_diameter(axis_id: ElementId) -> float: + """Gets the bolt diameter. Parameters: - axis_id: axis_id + axis_id: The id of the axis. Returns: - float + The bolt diameter. """ - def get_standard_connector_list() -> List[str]: """Returns a list of all standard connectors. Returns: - List[str] + The list of standard connector names. """ -def get_counterbore_diameter_for_start_side(axis_id: int, section_index: int, diameter: float, depth: float, +def get_counterbore_diameter_for_start_side(axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, is_conical: bool) -> float: - """get counterbore diameter for start side + """Gets the counterbore diameter for the start side. Parameters: - axis_id: axis_id - section_index: section_index - diameter: diameter - depth: depth - is_conical: is_conical + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) + diameter: [UNUSED PARAMETER] + depth: [UNUSED PARAMETER] + is_conical: [UNUSED PARAMETER] Returns: - float + The counterbore diameter for the start side. """ -def get_counterbore_diameter_for_end_side(axis_id: int, section_index: int) -> float: +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. Parameters: - axis_id: The ID of the axis. + axis_id: The id of the axis. section_index: The index of the section. Returns: - float: The counterbore diameter for the end side. + The counterbore diameter for the end side. """ -def get_counterbore_depth_for_start_side(axis_id: int, section_index: int) -> float: - """get counterbore depth for start side +def get_counterbore_depth_for_start_side(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Gets the counterbore depth for the start side. Parameters: - axis_id: The ID of the axis. + axis_id: The id of the axis. section_index: The index of the section. Returns: - float + The counterbore depth for the start side. """ -def get_counterbore_depth_for_end_side(axis_id: int, section_index: int) -> float: - """get counterbore depth for end side +def get_counterbore_depth_for_end_side(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Gets the counterbore depth for the end side. Parameters: - axis_id: The ID of the axis. - section_index: The index of the section + axis_id: The id of the axis. + section_index: The index of the section. Returns: - float + The counterbore depth for the end side. """ - -def get_counterbore_is_conical_for_start_side(axis_id: int, section_index: int) -> bool: - """get counterbore is conical for start side +def get_counterbore_is_conical_for_start_side(axis_id: ElementId, section_index: UnsignedInt) -> bool: + """Get if counterbore is conical for start side. Parameters: - axis_id: The ID of the axis. + axis_id: The id of the axis. section_index: The index of the section Returns: - bool + True if the counterbore is conical for the start side, false otherwise. """ -def get_counterbore_is_conical_for_end_side(axis_id: int, section_index: int) -> bool: - """get counterbore is conical for end side +def get_counterbore_is_conical_for_end_side(axis_id: ElementId, section_index: UnsignedInt) -> bool: + """Get if counterbore is conical for end side. Parameters: - axis_id: The ID of the axis. - section_index: The index of the section + axis_id: The id of the axis. + section_index: The index of the section. Returns: - bool - """ + True if the counterbore is conical for the end side, false otherwise. + """ -def set_counterbore_for_start_side(axis_id: int, section_index: int, diameter: float, depth: float, +def set_counterbore_for_start_side(axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, is_conical: bool) -> None: - """set counterbore for start side + """Sets the counterbore for the start side. Parameters: - axis_id: axis_id - section_index: section_index - diameter: diameter - depth: depth - is_conical: is_conical - - Returns: - None + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) + diameter: The diameter of the counterbore. + depth: The depth of the counterbore. + is_conical: True if the counterbore is conical, false otherwise. """ -def set_counterbore_for_end_side(axis_id: int, section_index: int, diameter: float, depth: float, +def set_counterbore_for_end_side(axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, is_conical: bool) -> None: - """set counterbore for end side + """Sets the counterbore for the end side. Parameters: - axis_id: axis_id - section_index: section_index - diameter: diameter - depth: depth - is_conical: is_conical - - Returns: - None + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) + diameter: The diameter of the counterbore. + depth: The depth of the counterbore. + is_conical: True if the counterbore is conical, false otherwise. """ -def get_intersection_count(intersection_index: int) -> int: - """get intersection count +def get_intersection_count(intersection_index: UnsignedInt) -> int: + """Get the intersection count. Parameters: - intersection_index: intersection_index + intersection_index: The index of the intersection. (0-based index) Returns: - int + The intersection count. """ - -def get_item_guids_at_intersection(axis_id: int, intersection_index: int) -> List[str]: - """get item guids at intersection +def get_item_guids_at_intersection(axis_id: ElementId, intersection_index: UnsignedInt) -> List[str]: + """Get item GUIDs at intersection. Parameters: - axis_id: axis_id - intersection_index: intersection_index + axis_id: The id of the axis. + intersection_index: The index of the intersection. (0-based index) Returns: - List[str] + The list of item GUIDs at the intersection. """ -def set_item_guids_at_intersection(axis_id: int, intersection_index: int, item_guids: List[str]) -> None: - """set item guids at intersection +def set_item_guids_at_intersection(axis_id: ElementId, intersection_index: UnsignedInt, item_guids: List[str]) -> None: + """Sets item GUIDs at intersection. Parameters: - axis_id: axis_id - intersection_index: intersection_index - item_guids: item_guids - - Returns: - None + axis_id: The id of the axis. + intersection_index: The index of the intersection. (0-based index) + item_guids: The item GUIDs to set. """ - -def get_section_length(axis_id: int, section_index: int) -> float: - """get section length +def get_section_length(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Get section length. Parameters: - axis_id: axis_id - section_index: section_index + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - float + The length of the section. """ -def get_section_oblong_drilling_is_enabled(axis_id: int, section_index: int) -> bool: - """get section oblong drilling is enabled +def get_section_oblong_drilling_is_enabled(axis_id: ElementId, section_index: UnsignedInt) -> bool: + """Get if the section oblong drilling is enabled. Parameters: - axis_id: axis_id - section_index: section_index + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - bool + True if the section oblong drilling is enabled, false otherwise. """ -def get_section_oblong_drilling_positive_value(axis_id: int, section_index: int) -> float: - """get section oblong drilling positive value +def get_section_oblong_drilling_positive_value(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Get section oblong drilling positive value. Parameters: - axis_id: axis_id - section_index: section_index + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - float + The positive value of the section oblong drilling. """ -def get_section_oblong_drilling_negative_value(axis_id: int, section_index: int) -> float: - """get section oblong drilling negative value +def get_section_oblong_drilling_negative_value(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Get the section oblong drilling negative value Parameters: - axis_id: axis_id - section_index: section_index + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - float + The negative value of the section oblong drilling. """ -def get_section_oblong_drilling_angle(axis_id: int, section_index: int) -> float: - """get section oblong drilling angle +def get_section_oblong_drilling_angle(axis_id: ElementId, section_index: UnsignedInt) -> float: + """Get section oblong drilling angle. Parameters: - axis_id: axis_id - section_index: section_index + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) Returns: - float + The angle of the section oblong drilling. """ -def set_section_oblong_drilling_is_disabled(axis_id: int, section_index: int) -> None: - """set section oblong drilling is disabled +def set_section_oblong_drilling_is_disabled(axis_id: ElementId, section_index: UnsignedInt) -> None: + """Disable the section oblong drilling. Parameters: - axis_id: axis_id - section_index: section_index - - Returns: - None + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) """ -def set_section_oblong_drilling_is_enabled(axis_id: int, section_index: int, positive_value: float, +def set_section_oblong_drilling_is_enabled(axis_id: ElementId, section_index: UnsignedInt, positive_value: float, negative_value: float, angle: float) -> None: - """set section oblong drilling is enabled + """Enable the section oblong drilling with parameters. Parameters: - axis_id: axis_id - section_index: section_index - positive_value: positive_value - negative_value: negative_value - angle: angle - - Returns: - None + axis_id: The id of the axis. + section_index: The index of the section. (0-based index) + positive_value: The positive value of the section oblong drilling. + negative_value: The negative value of the section oblong drilling. + angle: The angle of the section oblong drilling. """ From aa028afee9f28be77db62f3bcf4d21090b7d8717 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Wed, 20 Aug 2025 15:22:59 +0200 Subject: [PATCH 13/30] [API-519] Improved the dimension controller documentation --- src/dimension_controller/__init__.pyi | 224 +++++++++++--------------- 1 file changed, 96 insertions(+), 128 deletions(-) diff --git a/src/dimension_controller/__init__.pyi b/src/dimension_controller/__init__.pyi index cfe689d..03e7bf1 100644 --- a/src/dimension_controller/__init__.pyi +++ b/src/dimension_controller/__init__.pyi @@ -1,241 +1,209 @@ from typing import List -from cadwork import point_3d +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]) -> int: - """creates a dimension element +def create_dimension(xl: point_3d, plane_normal: point_3d, distance: point_3d, dimension_points: List[point_3d]) -> ElementId: + """Creates a dimension element. Parameters: - xl: xl - plane_normal: plane_normal - distance: distance - dimension_points: dimension_points + xl: The x direction of the dimension. + plane_normal: The normal vector of the dimension plane. + distance: The distance vector from the anchor point to the dimension reference point. + dimension_points: A list of dimension points. Returns: - elementID of created dimension element + The element id of the created dimension element. """ -def set_orientation(elements: List[int], view_dir: point_3d, view_dir_up: point_3d) -> None: - """sets the orientation of a dimension element +def set_orientation(element_id_list: List[ElementId], view_dir: point_3d, view_dir_up: point_3d) -> None: + """Sets the orientation of dimension elements. Parameters: - elements: elements - view_dir: view_dir - view_dir_up: view_dir_up - - Returns: - None + element_id_list: The element id list. + view_dir: The view direction vector. + view_dir_up: The view direction up vector. """ -def add_segment(element: int, segment: point_3d) -> None: - """adds a segment to a dimension element +def add_segment(element_id: ElementId, segment: point_3d) -> None: + """Adds a segment to a dimension element. Parameters: - element: element - segment: segment - - Returns: - None + element_id: The element id. + segment: The segment to add. """ -def set_precision(elements: List[int], precision: int) -> None: - """sets the precision/decimal places of a dimension element +def set_precision(element_id_list: List[ElementId], precision: UnsignedInt) -> None: + """Sets the precision/decimal places of a dimension element. Parameters: - elements: elements - precision: precision - - Returns: - None + element_id_list: The element id list. + precision: The precision/decimal places to set. """ -def set_text_size(elements: List[int], text_size: float) -> None: - """sets the text size a dimension element +def set_text_size(element_id_list: List[ElementId], text_size: float) -> None: + """Sets the text size of a dimension element. Parameters: - elements: elements - text_size: text_size - - Returns: - None + element_id_list: The element id list. + text_size: The text size to set. """ -def set_line_thickness(elements: List[int], thickness: float) -> None: - """sets the line thickness a dimension element +def set_line_thickness(element_id_list: List[ElementId], thickness: float) -> None: + """Sets the line thickness of a dimension element. Parameters: - elements: elements - thickness: thickness - - Returns: - None + element_id_list: The element id list. + thickness: The line thickness to set. """ -def set_total_dimension(elements: List[int], total: bool) -> None: - """sets if the total dimension is shown in a dimension element +def set_total_dimension(element_id_list: List[ElementId], total: bool) -> None: + """Set whether the visualisation of the overall dimension is set for a dimension element. Parameters: - elements: elements - total: total - - Returns: - None + element_id_list: The element id list. + total: True if the visualisation is set, false otherwise. """ -def set_text_color(elements: List[int], color_id: int) -> None: - """sets the text color a dimension element +def set_text_color(element_id_list: List[ElementId], color_id: ColorId) -> None: + """Sets the text color of a dimension element. Parameters: - elements: elements - color_id: color_id - - Returns: - None + element_id_list: The element id list. + color_id: The color id to set. """ -def set_line_color(elements: List[int], color_id: int) -> None: - """sets the line color a dimension element +def set_line_color(element_id_list: List[ElementId], color_id: ColorId) -> None: + """Sets the line color of a dimension element. Parameters: - elements: elements - color_id: color_id - - Returns: - None - """ + element_id_list: The element id list. + color_id: The color id to set. + """ -def set_default_anchor_length(elements: List[int], length: float) -> None: - """sets the default anchor length a dimension element +def set_default_anchor_length(element_id_list: List[ElementId], length: float) -> None: + """Sets the default anchor length of a dimension element. Parameters: - elements: elements - length: length - - Returns: - None + element_id_list: The element id list. + length: The default anchor length to set. """ -def set_distance(elements: List[int], distance: point_3d) -> None: - """sets the distance vector between the points and the line +def set_distance(element_id_list: List[ElementId], distance: point_3d) -> None: + """Sets the distance vector between the points and the line. Parameters: - elements: elements - distance: distance - - Returns: - None + element_id_list: The element id list. + distance: The distance vector to set. """ -def shift_distance_and_texts(elements: List[int], shifted: bool) -> None: - """sets if distance and texts are shifted +def shift_distance_and_texts(element_id_list: List[ElementId], shifted: bool) -> None: + """Sets if distance and texts are shifted. Parameters: - elements: elements - shifted: shifted - - Returns: - None + element_id_list: The element id list. + shifted: True if distance and texts are shifted, false otherwise. """ -def get_dimension_points(element: int) -> List[point_3d]: - """gets all dimension points ordered by dimension direction +def get_dimension_points(element_id: ElementId) -> List[point_3d]: + """Gets all dimension points ordered by dimension direction. Parameters: - element: element + element_id: The element id. Returns: - ICwAPI3DVertexList + A list of dimension points. """ -def get_default_anchor_length(element: int) -> float: - """gets the default anchor length +def get_default_anchor_length(element_id: ElementId) -> float: + """Gets the default anchor length. Parameters: - element: element + element_id: The element id. Returns: - double + The default anchor length. """ -def get_distance(element: int) -> point_3d: +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: element + element_id: The element id. Returns: - point_3d + The distance vector. """ -def get_plane_normal(element: int) -> point_3d: - """Get the plane normal +def get_plane_normal(element_id: ElementId) -> point_3d: + """Get the plane normal. Parameters: - element: element + element_id: The element id. Returns: - normal + The plane normal vector. """ -def get_plane_xl(element: int) -> point_3d: - """Get the plane x direction +def get_plane_xl(element_id: ElementId) -> point_3d: + """Get the plane x direction. Parameters: - element: element + element_id: The element id. Returns: - x direction + The plane x direction vector. """ -def get_segment_count(element: int) -> int: - """Get count of segments +def get_segment_count(element_id: ElementId) -> int: + """Get count of segments. Parameters: - element: element + element_id: The element id. Returns: - segment count + The number of segments. """ -def get_segment_distance(element: int, segment_index: int) -> float: - """Get the distance from the anchor point to the dimension segment +def get_segment_distance(element_id: ElementId, segment_index: int) -> float: + """Get the distance from the anchor point to the dimension segment. Parameters: - element: element - segment_index: segment_index + element_id: The element id. + segment_index: The segment index. Returns: - distance + The distance from the anchor point to the dimension segment. """ -def get_segment_direction(element: int, segment_index: int) -> point_3d: - """get segment direction +def get_segment_direction(element_id: ElementId, segment_index: int) -> point_3d: + """Get the normalized direction from the anchor point to the point on the dimension. Parameters: - element: element - segment_index: segment_index + element_id: The element id. + segment_index: The segment index. Returns: - point_3d + The segment direction vector. """ -def get_total_dimension(element: int) ->bool: - """get total dimension +def get_total_dimension(element_id: ElementId) -> bool: + """Query whether the visualisation of the overall dimension is set for a dimension element. Parameters: - element: element + element_id: The element id. Returns: - bool + 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: int) -> dimension_base_format: - """get dimension base format +def get_dimension_base_format(element_id: ElementId) -> dimension_base_format: + """Get the dimension base format. Parameters: - element: element + element_id: The element id. Returns: - dimension_base_format + 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. """ From 7e1d183d187b3ba76227e207c8b6512358234839 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 10:50:51 +0200 Subject: [PATCH 14/30] [API-519] Improved the element controller documentation --- docs/documentation/coordinate_system_data.md | 6 + docs/documentation/hit_result.md | 6 +- docs/documentation/shoulder_options.md | 5 + docs/documentation/standard_element_type.md | 6 + mkdocs.yml | 2 + src/element_controller/__init__.pyi | 2112 ++++++++---------- 6 files changed, 962 insertions(+), 1175 deletions(-) create mode 100644 docs/documentation/coordinate_system_data.md create mode 100644 docs/documentation/standard_element_type.md diff --git a/docs/documentation/coordinate_system_data.md b/docs/documentation/coordinate_system_data.md new file mode 100644 index 0000000..f499bb6 --- /dev/null +++ b/docs/documentation/coordinate_system_data.md @@ -0,0 +1,6 @@ +# coordinate_system_data + +::: cadwork.coordinate_system_data + rendering: + show_root_heading: false + show_source: true diff --git a/docs/documentation/hit_result.md b/docs/documentation/hit_result.md index d974af8..18e66b2 100644 --- a/docs/documentation/hit_result.md +++ b/docs/documentation/hit_result.md @@ -1,6 +1,6 @@ # hit_result ::: cadwork.hit_result -rendering: -show_root_heading: false -show_source: true + rendering: + show_root_heading: false + show_source: true diff --git a/docs/documentation/shoulder_options.md b/docs/documentation/shoulder_options.md index 6b5547b..fe04389 100644 --- a/docs/documentation/shoulder_options.md +++ b/docs/documentation/shoulder_options.md @@ -4,6 +4,11 @@ rendering: show_root_heading: false show_source: true + +::: cadwork.shoulder_options + rendering: + show_root_heading: false + show_source: true ::: cadwork.heel_shoulder_beam_geometry rendering: diff --git a/docs/documentation/standard_element_type.md b/docs/documentation/standard_element_type.md new file mode 100644 index 0000000..fe6efdc --- /dev/null +++ b/docs/documentation/standard_element_type.md @@ -0,0 +1,6 @@ +# standard_element_type + +::: cadwork.standard_element_type + rendering: + show_root_heading: false + show_source: true diff --git a/mkdocs.yml b/mkdocs.yml index 5af63a9..a41f720 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -42,6 +42,7 @@ nav: - Attribute Display Settings: documentation/attribute_display_settings.md - Element Module Properties: documentation/element_module_properties.md - Element Type: documentation/element_type.md + - Standard Element Type: documentation/standard_element_type.md - Process Type: documentation/process_type.md - Point 3D: documentation/point_3d.md - Enumerations: documentation/enums.md @@ -61,6 +62,7 @@ nav: - Element Filter: documentation/element_filter.md - Element Map Query: documentation/element_map_query.md - Hit Result: documentation/hit_result.md + - Coordinate System Data: documentation/coordinate_system_data.md - Connector Axis Controller: documentation/connector_axis_controller.md - Dimension Controller: documentation/dimension_controller.md - Element Controller: documentation/element_controller.md diff --git a/src/element_controller/__init__.pyi b/src/element_controller/__init__.pyi index ebe9c3a..f0f59bc 100644 --- a/src/element_controller/__init__.pyi +++ b/src/element_controller/__init__.pyi @@ -3,6 +3,7 @@ from cadwork.edge_list import edge_list from cadwork.element_module_properties import element_module_properties from cadwork.facet_list import facet_list from cadwork.point_3d import point_3d +from cadwork.standard_element_type import standard_element_type from cadwork.text_object_options import text_object_options from cadwork.coordinate_system_data import coordinate_system_data from cadwork.element_map_query import element_map_query @@ -12,53 +13,44 @@ from cadwork.vertex_list import vertex_list from cadwork.shoulder_options import shoulder_options from cadwork.heel_shoulder_options import heel_shoulder_options from cadwork.double_shoulder_options import double_shoulder_options +from cadwork.api_types import * - -def delete_elements(element_id_list: List[int]) -> None: - """delete elements +def delete_elements(element_id_list: List[ElementId]) -> None: + """Deletes the specified elements. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def join_elements(element_id_list: List[int]) -> None: - """join elements - +def join_elements(element_id_list: List[ElementId]) -> None: + """Joins the specified elements together. + Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def join_top_level_elements(element_id_list: List[int]) -> None: - """join top level elements +def join_top_level_elements(element_id_list: List[ElementId]) -> None: + """Joins the specified top-level elements together. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def create_rectangular_beam_points(width: float, height: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create rectangular beam points +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: - width: width - height: height - p1: p1 - p2: p2 - p3: p3 + width: The width of the beam. + height: The height of the beam. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> beam_width = 200. >>> beam_height = 400. >>> beam_axis_start_pt = cadwork.point_3d(300., 0., 0.) - >>> beam_axis_end_pt = cadwork.point_3d(300., 0., 4000.) + >>> beam_axis_end_pt = cadwork.point_3d(300., 0., 4000.) >>> length_vector = (beam_axis_end_pt - beam_axis_start_pt).normalized() >>> beam_axis_y = cadwork.point_3d(1., 0., 0.) >>> beam_axis_z = length_vector.cross(beam_axis_y).normalized() @@ -66,17 +58,17 @@ def create_rectangular_beam_points(width: float, height: float, p1: point_3d, p2 >>> beam_id = ec.create_rectangular_beam_points(beam_width, beam_height, beam_axis_start_pt, beam_axis_end_pt, beam_height_axis_pt ) Returns: - int + The ID of the created rectangular beam. """ -def create_circular_beam_points(diameter: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create circular beam points +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: - diameter: diameter - p1: p1 - p2: p2 - p3: p3 + diameter: The diameter of the beam. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> beam_diameter = 120. @@ -89,17 +81,17 @@ def create_circular_beam_points(diameter: float, p1: point_3d, p2: point_3d, p3: >>> beam_id = ec.create_circular_beam_points(beam_diameter, beam_axis_start_pt, beam_axis_end_pt, beam_orientation_pt) Returns: - int + The ID of the created circular beam. """ -def create_square_beam_points(width: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create square beam points +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: - width: width - p1: p1 - p2: p2 - p3: p3 + width: The width of the beam. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> beam_width = 100. @@ -112,19 +104,19 @@ def create_square_beam_points(width: float, p1: point_3d, p2: point_3d, p3: poin >>> beam_id = ec.create_square_beam_points(beam_width, beam_axis_start_pt, beam_axis_end_pt, orientation_pt) Returns: - int + The ID of the created square beam. """ -def create_rectangular_beam_vectors(width: float, height: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create rectangular beam vectors +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: - width: width - height: height - length: length - p1: p1 - xl: xl - zl: zl + width: The width of the beam. + height: The height of the beam. + length: The length of the beam. + starting_point: The starting point. + x_local_direction: The direction of the X-axis. + z_local_direction: The direction of the Z-axis. Examples: >>> beam_width = 150. @@ -136,18 +128,18 @@ def create_rectangular_beam_vectors(width: float, height: float, length: float, >>> beam_id = ec.create_rectangular_beam_vectors(beam_width, beam_height, beam_length, origin_point, x_direction, z_direction) Returns: - int + The ID of the created rectangular beam. """ -def create_circular_beam_vectors(diameter: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create circular beam vectors +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: - diameter: diameter - length: length - p1: p1 - xl: xl - zl: zl + diameter: The diameter of the beam. + length: The length of the beam. + starting_point: The starting point of the beam. + x_local_direction: The local X direction vector. + z_local_direction: The local Z direction vector. Examples: >>> beam_diameter = 100. @@ -158,18 +150,18 @@ def create_circular_beam_vectors(diameter: float, length: float, p1: point_3d, x >>> beam_id = ec.create_circular_beam_vectors(beam_diameter, beam_length, origin_point, x_direction, z_direction) Returns: - int + The ID of the created circular beam. """ -def create_square_beam_vectors(width: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create square beam vectors +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: - width: width - length: length - p1: p1 - xl: xl - zl: zl + width: The width of the beam. + length: The length of the beam. + starting_point: The starting point of the beam. + x_local_direction: The local X direction vector. + z_local_direction: The local Z direction vector. Examples: >>> beam_width = 120. @@ -180,18 +172,18 @@ def create_square_beam_vectors(width: float, length: float, p1: point_3d, xl: po >>> beam_id = ec.create_square_beam_vectors(beam_width, beam_length, origin_point, x_direction, z_direction) Returns: - int + The ID of the created square beam. """ -def create_rectangular_panel_points(width: float, thickness: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create rectangular panel points +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: - width: width - thickness: thickness - p1: p1 - p2: p2 - p3: p3 + width: The width of the panel. + thickness: The thickness of the panel. + first_point: The first corner point of the panel. + second_point: The second corner point of the panel. + third_point: The third corner point of the panel. Examples: >>> panel_width = 1200. @@ -204,19 +196,19 @@ def create_rectangular_panel_points(width: float, thickness: float, p1: point_3d >>> panel_id = ec.create_rectangular_panel_points(panel_width, panel_thickness, panel_corner_pt, panel_length_pt, orientation_pt) Returns: - int + The ID of the created rectangular panel. """ -def create_rectangular_panel_vectors(width: float, thickness: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create rectangular panel vectors +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: - width: width - thickness: thickness - length: length - p1: p1 - xl: xl - zl: zl + width: The width of the panel. + thickness: The thickness of the panel. + length: The length of the panel. + starting_point: The starting point of the panel. + x_local_direction: The local X direction vector. + z_local_direction: The local Z direction vector. Examples: >>> panel_width = 1000. @@ -228,16 +220,16 @@ def create_rectangular_panel_vectors(width: float, thickness: float, length: flo >>> panel_id = ec.create_rectangular_panel_vectors(panel_width, panel_thickness, panel_length, origin_point, x_direction, z_direction) Returns: - int + The ID of the created rectangular panel. """ -def create_drilling_points(diameter: float, p1: point_3d, p2: point_3d) -> int: - """create drilling points +def create_drilling_points(diameter: float, first_point: point_3d, second_point: point_3d) -> ElementId: + """Creates drilling using points. Parameters: - diameter: diameter - p1: p1 - p2: p2 + diameter: The diameter of the drilling. + first_point: The starting point of the drilling. + second_point: The ending point of the drilling. Examples: >>> drill_diameter = 30. @@ -246,17 +238,17 @@ def create_drilling_points(diameter: float, p1: point_3d, p2: point_3d) -> int: >>> drilling_id = ec.create_drilling_points(drill_diameter, drill_start_pt, drill_end_pt) Returns: - int + The ID of the created drilling. """ -def create_drilling_vectors(diameter: float, length: float, p1: point_3d, xl: point_3d) -> int: - """create drilling vectors +def create_drilling_vectors(diameter: float, length: float, starting_point: point_3d, drilling_direction: point_3d) -> ElementId: + """Creates drilling using vectors. Parameters: - diameter: diameter - length: length - p1: p1 - xl: xl + diameter: The diameter of the drilling. + length: The length of the drilling. + starting_point: The starting point of the drilling. + drilling_direction: The direction of the drilling. Examples: >>> drill_diameter = 12. @@ -266,15 +258,15 @@ def create_drilling_vectors(diameter: float, length: float, p1: point_3d, xl: po >>> drilling_id = ec.create_drilling_vectors(drill_diameter, drill_length, drill_start_pt, drill_direction) Returns: - int + The ID of the created drilling. """ -def create_line_points(p1: point_3d, p2: point_3d) -> int: - """create line points +def create_line_points(first_point: point_3d, second_point: point_3d) -> ElementId: + """Creates a line using points. Parameters: - p1: p1 - p2: p2 + first_point: The first point of the line. + second_point: The second point of the line. Examples: >>> line_start_pt = cadwork.point_3d(0., 0., 0.) @@ -282,16 +274,16 @@ def create_line_points(p1: point_3d, p2: point_3d) -> int: >>> line_id = ec.create_line_points(line_start_pt, line_end_pt) Returns: - int + The ID of the created line. """ -def create_line_vectors(length: float, p1: point_3d, xl: point_3d) -> int: - """create line vectors +def create_line_vectors(length: float, starting_point: point_3d, line_direction: point_3d) -> ElementId: + """Creates a line using vectors. Parameters: - length: length - p1: p1 - xl: xl + length: The length of the line. + starting_point: The starting point of the line. + line_direction: The direction of the line. Examples: >>> line_length = 1000. @@ -300,93 +292,78 @@ def create_line_vectors(length: float, p1: point_3d, xl: point_3d) -> int: >>> line_id = ec.create_line_vectors(line_length, line_start_pt, line_direction) Returns: - int + The ID of the created line. """ -def create_node(p1: point_3d) -> int: - """create node +def create_node(node_position: point_3d) -> ElementId: + """Creates a node. Parameters: - p1: p1 + node_position: The position of the node. Examples: >>> node_position = cadwork.point_3d(250., 250., 100.) >>> node_id = ec.create_node(node_position) Returns: - int + The ID of the created node. """ -def solder_elements(element_id_list: List[int]) -> List[int]: - """solder elements +def solder_elements(element_id_list: List[ElementId]) -> List[ElementId]: + """Solders elements together. Parameters: - element_id_list: element_id_list + element_id_list: The element id list. Returns: - List[int] + The list of soldered element IDs. """ -def convert_beam_to_panel(element_id_list: List[int]) -> None: - """convert beam to panel +def convert_beam_to_panel(element_id_list: List[ElementId]) -> None: + """Converts beams to panels. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def convert_panel_to_beam(element_id_list: List[int]) -> None: - """convert panel to beam +def convert_panel_to_beam(element_id_list: List[ElementId]) -> None: + """Converts panels to beams. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def delete_all_element_end_types(element_id_list: List[int]) -> None: - """delete all element end types +def delete_all_element_end_types(element_id_list: List[ElementId]) -> None: + """Deletes all end types of the elements. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def delete_all_element_processes(element_id_list: List[int]) -> None: - """delete all element processes +def delete_all_element_processes(element_id_list: List[ElementId]) -> None: + """Deletes all processes of the elements. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ -def move_element(element_id_list: List[int], vector: point_3d) -> None: - """move element +def move_element(element_id_list: List[ElementId], move_vector: point_3d) -> None: + """Moves the provided element by a specified vector. Parameters: - element_id_list: element_id_list - vector: vector - - Returns: - None + element_id_list: The element id list. + move_vector: The vector by which to move the elements. """ -def create_polygon_beam(polygon_vertices: vertex_list, thickness: float, xl: point_3d, zl: point_3d) -> int: - """create polygon beam +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: - polygon_vertices: polygon_vertices - thickness: thickness - xl: xl - zl: zl + polygon_vertices: The vertices of the polygon. + thickness: The thickness of the beam. + x_local_direction: The x local direction of the beam. + z_local_direction: The z local direction of the beam. Examples: >>> # Create a triangular beam @@ -400,18 +377,18 @@ def create_polygon_beam(polygon_vertices: vertex_list, thickness: float, xl: poi >>> polygon_beam_id = ec.create_polygon_beam(vertices, beam_thickness, extrusion_vector, z_vector) Returns: - int + The ID of the created polygon beam. """ -def create_text_object(text: str, position: point_3d, xl: point_3d, zl: point_3d, size: float) -> int: - """create text object +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: - text: text - position: position - xl: xl - zl: zl - size: size + text: The text content. + position: The position of the text. + x_local_direction: The x local direction of the text. + z_local_direction: The z local direction of the text. + size: The size of the text. Examples: >>> text_content = "Cadwork API" @@ -422,172 +399,142 @@ def create_text_object(text: str, position: point_3d, xl: point_3d, zl: point_3d >>> text_id = ec.create_text_object(text_content, text_position, x_direction, z_direction, text_height) Returns: - int + The ID of the created text object. """ -def copy_elements(element_id_list: List[int], copy_vector: point_3d) -> List[int]: - """copy elements +def copy_elements(element_id_list: List[ElementId], copy_vector: point_3d) -> List[int]: + """Copy a list of elements. Parameters: - element_id_list: element_id_list - copy_vector: copy_vector + element_id_list: The element id list. + copy_vector: The vector by which to copy the elements. Returns: - List[int] + The IDs of the copied elements. """ -def rotate_elements(element_id_list: List[int], origin: point_3d, rotation_axis: point_3d, rotation_angle: float) -> None: - """rotate elements +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: - element_id_list: element_id_list - origin: origin - rotation_axis: rotation_axis - rotation_angle: rotation_angle - - Returns: - None + element_id_list: The element id list. + origin: The origin point of the rotation. + rotation_axis: The axis around which to rotate the elements. + rotation_angle: The angle by which to rotate the elements un degree. """ -def subtract_elements(hard_elements: List[int], soft_elements: List[int]) -> List[int]: - """subtract elements +def subtract_elements(hard_elements: List[ElementId], soft_elements: List[ElementId]) -> List[ElementId]: + """Subtracts a list of "soft" elements from a list of "hard" elements. Parameters: - hard_elements: hard_elements - soft_elements: soft_elements + hard_elements: The list of "hard" elements. + soft_elements: The list of "soft" elements. Returns: - List[int] + The list of resulting elements. """ -def check_element_id(element_id: int) -> bool: - """check element id +def check_element_id(element_id: ElementId) -> bool: + """Check if the provided element ID exists. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element ID exists, false otherwise. """ -def start_element_module_calculation(covers: List[int]) -> None: - """start element module calculation +def start_element_module_calculation(covers: List[ElementId]) -> None: + """Starts the calculation of the element module for a list of covers. Parameters: - covers: covers - - Returns: - None + covers: The list of cover element IDs. """ def set_element_detail_path(path: str) -> None: - """set element detail path + """Sets the detail path for the element. Parameters: - path: path - - Returns: - None + path: The detail path. """ -def get_element_from_cadwork_guid(cadwork_guid: str) -> int: - """get element from cadwork guid +def get_element_from_cadwork_guid(cadwork_guid: str) -> ElementId: + """Gets element from cadwork guid. Parameters: - cadwork_guid: cadwork_guid + cadwork_guid: The cadwork guid. Returns: - int + The element ID. """ -def add_elements_to_undo(elements: List[int], cmd: int) -> None: - """add elements to undo +def add_elements_to_undo(element_id_list: List[ElementId], cmd: int) -> None: + """Add elements to the undo stack. Parameters: - elements: elements - cmd: cmd - - Returns: - None + element_id_list: The elements to add. + cmd: The command associated with the undo. """ def make_undo() -> None: - """make undo - - Returns: - None + """Performs an undo operation, reverting the last change made. """ def make_redo() -> None: - """make redo - - Returns: - None + """Performs a redo operation, reapplying the last undone change. """ -def split_elements(elements: List[int]) -> None: - """split elements +def split_elements(element_id_list: List[ElementId]) -> None: + """Splits elements. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to split. """ -def set_line_to_marking_line(elements: List[int]) -> None: - """set line to marking line +def set_line_to_marking_line(element_id_list: List[ElementId]) -> None: + """Sets the line to the marking line. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to modify. """ -def set_line_to_normal_line(elements: List[int]) -> None: - """set line to normal line +def set_line_to_normal_line(element_id_list: List[ElementId]) -> None: + """Sets the line to the normal line. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to modify. """ -def create_auto_export_solid_from_standard(elements: List[int], output_name: str, standard_element_name: str) -> int: - """create auto export solid from standard +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: - elements: elements - output_name: output_name - standard_element_name: standard_element_name + element_id_list: The elements to use. + output_name: The output name. + standard_element_name: The standard element name. Returns: - int + The element ID of the created solid. """ -def set_element_module_properties_for_elements(elements: List[int], properties: None) -> None: - """set element module properties for elements +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: - elements: elements - properties: properties - - Returns: - None + element_id_list: The elements to modify. + properties: The properties to set. """ -def create_text_object_with_font(text: str, position: point_3d, xl: point_3d, zl: point_3d, size: float, font_name: str) -> int: - """create text object with font +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: - text: text - position: position - xl: xl - zl: zl - size: size - font_name: font_name + text: The text to be displayed in the text object. + position: The position of the text object. + x_local_direction: The X-axis direction of the text object. + z_local_direction: The Z-axis direction of the text object. + size: The size of the text object. + font_name: The font name. Examples: >>> text_content = "Custom Text" @@ -599,128 +546,104 @@ def create_text_object_with_font(text: str, position: point_3d, xl: point_3d, zl >>> text_id = ec.create_text_object_with_font(text_content, text_position, x_direction, z_direction, text_height, font) Returns: - int + The element ID of the created text object. """ -def apply_transformation_coordinate(elements: List[int], old_point: point_3d, old_xl: point_3d, old_yl: point_3d, new_point: point_3d, new_xl: point_3d, new_yl: point_3d) -> None: - """apply transformation coordinate +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: - elements: elements - old_point: old_point - old_xl: old_xl - old_yl: old_yl - new_point: new_point - new_xl: new_xl - new_yl: new_yl - - Returns: - None + element_id_list: The elements to modify. + old_point: The old point. + old_x_local_direction: The old X local direction. + old_y_local_direction: The old Y local direction. + new_point: The new point. + new_x_local_direction: The new X local direction. + new_y_local_direction: The new Y local direction. """ -def delete_elements_with_undo(elements: List[int]) -> None: - """delete elements with undo +def delete_elements_with_undo(element_id_list: List[ElementId]) -> None: + """Deletes the provided elements with undo functionality. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to delete. """ -def add_created_elements_to_undo(elements: List[int]) -> None: - """add created elements to undo +def add_created_elements_to_undo(element_id_list: List[ElementId]) -> None: + """Adds created elements to the undo stack. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to add. """ -def add_modified_elements_to_undo(elements: List[int]) -> None: - """add modified elements to undo +def add_modified_elements_to_undo(element_id_list: List[ElementId]) -> None: + """Adds modified elements to the undo stack. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to add. """ -def recreate_elements(elements: List[int]) -> None: - """recreate elements +def recreate_elements(element_id_list: List[ElementId]) -> None: + """Recreate elements based on the provided list. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to recreate. """ -def create_multi_wall(elements: List[int]) -> None: - """create multi wall +def create_multi_wall(element_id_list: List[ElementId]) -> None: + """Creates a multi-wall structure. Parameters: - elements: elements - - Returns: - None + element_id_list: The elements to use in the multi-wall structure. """ -def get_user_element_ids() -> List[int]: - """get user element ids +def get_user_element_ids() -> List[ElementId]: + """Gets a list of user element IDs. Returns: - List[int] + The user element IDs. """ -def get_user_element_ids_with_existing(elements: List[int]) -> List[int]: - """get user element ids with existing +def get_user_element_ids_with_existing(element_id_list: List[ElementId]) -> List[ElementId]: + """Retrieve a list of user element IDs that exist in the provided list. Parameters: - elements: elements + element_id_list: The elements to check for existence. Returns: - List[int] + The list of existing user element IDs. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ -def glide_elements(element_i_ds: List[int], glide_point: point_3d) -> None: - """glide elements +def glide_elements(element_id_list: List[ElementId], glide_point: point_3d) -> None: + """Glides elements to a specified point. Parameters: - element_i_ds: element_i_ds - glide_point: glide_point - - Returns: - None + element_id_list: The elements to glide. + glide_point: The glide destination point. """ -def cut_elements_with_miter(first_id: int, second_id: int) -> bool: - """cut elements with miter +def cut_elements_with_miter(first_id: ElementId, second_id: ElementId) -> bool: + """Cut two elements with a miter joint. Parameters: - first_id: first_id - second_id: second_id + first_id: The ID of the first element. + second_id: The ID of the second element. Returns: - bool + True if the cut operation was successful, false otherwise. """ -def cut_element_with_plane(element_id: int, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> bool: - """cut element with plane +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: - element_id: element_id - cut_plane_normal_vector: cut_plane_normal_vector - distance_from_global_origin: distance_from_global_origin + element_id: The element id. + cut_plane_normal_vector: The normal vector of the cut plane. + distance_from_global_origin: The distance from the global origin to the cut plane. Examples: >>> import math @@ -740,39 +663,39 @@ def cut_element_with_plane(element_id: int, cut_plane_normal_vector: point_3d, d >>> print(f"Cut operation successful: {result}") Returns: - bool + True if the cut operation was successful, false otherwise. """ -def create_circular_mep(diameter: float, points: List[point_3d]) -> int: - """create circular mep +def create_circular_mep(diameter: float, points: List[point_3d]) -> ElementId: + """Create a circular MEP (Mechanical, Electrical, and Plumbing) element. Parameters: - diameter: diameter - points: points + diameter: The diameter of the circular MEP. + points: The points defining the circular MEP. Returns: - int + The ID of the created circular MEP element. """ -def create_rectangular_mep(width: float, depth: float, points: List[point_3d]) -> int: - """create rectangular mep +def create_rectangular_mep(width: float, depth: float, points: List[point_3d]) -> ElementId: + """Create a rectangular MEP (Mechanical, Electrical, and Plumbing) element. Parameters: - width: width - depth: depth - points: points + width: The width of the rectangular MEP. + depth: The depth of the rectangular MEP. + points: The points defining the rectangular MEP. Returns: - int + The ID of the created rectangular MEP element. """ -def slice_element_with_plane(element_id: int, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> bool: - """slice element with plane +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: - element_id: element_id - cut_plane_normal_vector: cut_plane_normal_vector - distance_from_global_origin: distance_from_global_origin + element_id: The element id. + cut_plane_normal_vector: The normal vector of the cut plane. + distance_from_global_origin: The distance from the global origin to the slicing plane. Examples: >>> import math @@ -800,53 +723,53 @@ def slice_element_with_plane(element_id: int, cut_plane_normal_vector: point_3d, >>> # Note: slice_element_with_plane keeps both parts as a joined element Returns: - bool + True if the slicing operation was successful, false otherwise. """ -def create_auto_container_from_standard(elements: List[int], output_name: str, standard_element_name: str) -> int: - """create auto container from standard +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: - elements: elements - output_name: output_name - standard_element_name: standard_element_name + element_id_list: The list of elements to be used in the auto container. + output_name: The name of the output. + standard_element_name: The name of the standard element. Returns: - int + The id of the created auto container element. """ -def create_auto_export_solid_from_standard_with_reference(elements: List[int], output_name: str, standard_element_name: str, reference_id: int) -> int: - """create auto export solid from standard with reference +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: - elements: elements - output_name: output_name - standard_element_name: standard_element_name - reference_id: reference_id + element_id_list: The list of elements to be used in the export solid. + output_name: The name of the output. + standard_element_name: The name of the standard element. + reference_id: The ID of the reference element. Returns: - int + The id of the created auto export solid element. """ -def create_auto_container_from_standard_with_reference(elements: List[int], output_name: str, standard_element_name: str, reference_id: int) -> int: - """create auto container from standard with reference +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: - elements: elements - output_name: output_name - standard_element_name: standard_element_name - reference_id: reference_id + element_id_list: The list of elements to be used in the auto container. + output_name: The name of the output. + standard_element_name: The name of the standard element. + reference_id: The ID of the reference element. Returns: - int + The ID of the created auto container element. """ -def create_surface(surface_vertices: vertex_list) -> int: - """create surface +def create_surface(surface_vertices: vertex_list) -> ElementId: + """Creates a surface from a list of vertices. Parameters: - surface_vertices: surface_vertices + surface_vertices: The list of vertices defining the surface. Examples: >>> # Create a rectangular surface @@ -858,106 +781,85 @@ def create_surface(surface_vertices: vertex_list) -> int: >>> surface_id = ec.create_surface(vertices) Returns: - int + The ID of the created surface element. """ -def stretch_start_facet(elements: List[int], stretch_vector: point_3d) -> None: - """stretch start facet +def stretch_start_facet(element_id_list: List[ElementId], stretch_vector: point_3d) -> None: + """Stretch the start facet of the given elements. Parameters: - elements: elements - stretch_vector: a vector that defines the stretch direction and distance - - Returns: - None + element_id_list: The list of elements to be stretched. + stretch_vector: A vector that defines the stretch direction and distance. """ -def stretch_end_facet(elements: List[int], stretch_vector: point_3d) -> None: - """stretch end facet +def stretch_end_facet(element_id_list: List[ElementId], stretch_vector: point_3d) -> None: + """Stretch the end facet of the given elements. Parameters: - elements: elements - stretch_vector: a vector that defines the stretch direction and distance - - Returns: - None + element_id_list: The list of elements to be stretched. + stretch_vector: A vector that defines the stretch direction and distance. """ -def set_export_solid_contents(export_solid_id: int, element_i_ds: List[int]) -> None: - """set export solid contents +def set_export_solid_contents(export_solid_id: ElementId, element_id_list: List[ElementId]) -> None: + """Sets the contents of an export solid. Parameters: - export_solid_id: export_solid_id - element_i_ds: element_i_ds - - Returns: - None + export_solid_id: The ID of the export solid to set the contents for. + element_id_list: The list of element IDs to set as the contents of the export solid. """ -def set_container_contents(container_id: int, element_i_ds: List[int]) -> None: - """set container contents +def set_container_contents(container_id: ElementId, element_id_list: List[ElementId]) -> None: + """Sets the contents of a container. Parameters: - container_id: container_id - element_i_ds: element_i_ds - - Returns: - None + container_id: The ID of the container to set the contents for. + element_id_list: The list of element IDs to set as the contents of the container. """ -def set_parent_opening_variants_opening_angle(element_i_ds: List[int], angle: float) -> None: - """set parent opening variants opening angle +def set_parent_opening_variants_opening_angle(element_id_list: List[ElementId], angle: float) -> None: + """Sets the opening angle of the parent opening variants. Parameters: - element_i_ds: element_i_ds - angle: angle - - Returns: - None + element_id_list: The list of element IDs to set the opening angle for. + angle: The opening angle to set. """ -def mirror_move_elements(elements: List[int], plane: point_3d, plane_distance: float) -> None: - """mirror move elements +def mirror_move_elements(element_id_list: List[ElementId], plane: point_3d, plane_distance: float) -> None: + """Mirrors and moves elements across a plane. Parameters: - elements: elements - plane: plane - plane_distance: plane_distance - - Returns: - None + element_id_list: The list of element IDs to mirror and move. + plane: The plane to mirror across. + plane_distance: The distance from the plane. """ -def mirror_copy_elements(elements: List[int], plane: point_3d, plane_distance: float) -> List[int]: - """mirror copy elements +def mirror_copy_elements(element_id_list: List[ElementId], plane: point_3d, plane_distance: float) -> List[ElementId]: + """Copies elements by mirroring them across a plane. Parameters: - elements: elements - plane: plane - plane_distance: plane_distance + element_id_list: The ID of the element to copy. + plane: The plane to mirror across. + plane_distance: The distance from the plane. Returns: - List[int] + The list of IDs of the copied elements. """ -def reset_element_cadwork_guid(element_id: int) -> None: - """reset element cadwork guid +def reset_element_cadwork_guid(element_id: ElementId) -> None: + """Sets the Cadwork Guid of an element to NULL. Parameters: - element_id: element_id - - Returns: - None + element_id: The element id. """ -def create_standard_beam_points(standard_element_name: str, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create standard beam points +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: - standard_element_name: standard_element_name - p1: p1 - p2: p2 - p3: p3 + standard_element_name: The name of the standard element. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> std_beam_name = "Standard-Timber-120x240" # Name as found in standard elements library @@ -971,18 +873,18 @@ def create_standard_beam_points(standard_element_name: str, p1: point_3d, p2: po >>> std_beam_id = ec.create_standard_beam_points(std_beam_name, beam_start_pt, beam_end_pt, orientation_pt) Returns: - int + The ID of the created standard beam. """ -def create_standard_beam_vectors(standard_element_name: str, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create standard beam vectors +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: - standard_element_name: standard_element_name - length: length - p1: p1 - xl: xl - zl: zl + standard_element_name: The name of the standard element. + length: The length of the beam. + starting_point: The starting point of the beam. + x_local_direction: The local X direction vector. + z_local_direction: The local Z direction vector. Examples: >>> std_beam_name = "Standard-Timber-100x100" # Name as found in standard elements library @@ -993,17 +895,17 @@ def create_standard_beam_vectors(standard_element_name: str, length: float, p1: >>> std_beam_id = ec.create_standard_beam_vectors(std_beam_name, beam_length, origin_point, x_direction, z_direction) Returns: - int + The ID of the created standard beam. """ -def create_standard_panel_points(standard_element_name: str, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create standard panel points +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: - standard_element_name: standard_element_name - p1: p1 - p2: p2 - p3: p3 + standard_element_name: The name of the standard element. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> std_panel_name = "Standard-Panel-27mm" # Name as found in standard elements library @@ -1015,18 +917,18 @@ def create_standard_panel_points(standard_element_name: str, p1: point_3d, p2: p >>> std_panel_id = ec.create_standard_panel_points(std_panel_name, panel_corner_pt, panel_width_pt, orientation_pt) Returns: - int + The id of the created standard panel. """ -def create_standard_panel_vectors(standard_element_name: str, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create standard panel vectors +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: - standard_element_name: standard_element_name - length: length - p1: p1 - xl: xl - zl: zl + standard_element_name: The name of the standard element. + length: The length of the panel. + starting_point: The starting point of the panel. + x_local_direction: The local X direction vector. + z_local_direction: The local Z direction vector. Examples: >>> std_panel_name = "Standard-Panel-20mm" # Name as found in standard elements library @@ -1037,17 +939,17 @@ def create_standard_panel_vectors(standard_element_name: str, length: float, p1: >>> std_panel_id = ec.create_standard_panel_vectors(std_panel_name, panel_length, origin_point, x_direction, z_direction) Returns: - int + The id of the created standard panel. """ -def create_standard_steel_points(standard_element_name: str, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create standard steel points +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: - standard_element_name: standard_element_name - p1: p1 - p2: p2 - p3: p3 + standard_element_name: The name of the standard element. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> std_steel_name = "IPE 200" # Name of standard steel profile from library @@ -1061,18 +963,18 @@ def create_standard_steel_points(standard_element_name: str, p1: point_3d, p2: p >>> steel_id = ec.create_standard_steel_points(std_steel_name, steel_start_pt, steel_end_pt, orientation_pt) Returns: - int + The id of the created standard steel element. """ -def create_standard_steel_vectors(standard_element_name: str, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create standard steel vectors +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: - standard_element_name: standard_element_name - length: length - p1: p1 - xl: xl - zl: zl + standard_element_name: The name of the standard element. + length: The length of the element. + starting_point: The starting point of the element. + x_local_direction: The local X direction vector. + z_local_direction: The local Z direction vector. Examples: >>> std_steel_name = "HEA 220" # Name of standard steel profile from library @@ -1083,26 +985,23 @@ def create_standard_steel_vectors(standard_element_name: str, length: float, p1: >>> steel_id = ec.create_standard_steel_vectors(std_steel_name, steel_length, origin_point, x_direction, z_direction) Returns: - int + The id of the created standard steel element. """ -def move_element_with_undo(element_id_list: List[int], vector: point_3d) -> None: - """move element with undo +def move_element_with_undo(element_id_list: List[ElementId], vector: point_3d) -> None: + """Moves an element with undo functionality. Parameters: - element_id_list: element_id_list - vector: vector - - Returns: - None + element_id_list: The element id list. + vector: The vector to move the element. """ -def create_normal_axis_points(p1: point_3d, p2: point_3d) -> int: - """create normal axis points +def create_normal_axis_points(first_point: point_3d, second_point: point_3d) -> ElementId: + """Creates a normal axis using points. Parameters: - p1: p1 - p2: p2 + first_point: The first point of the axis. + second_point: The second point of the axis. Examples: >>> axis_start_pt = cadwork.point_3d(0., 0., 0.) @@ -1110,16 +1009,16 @@ def create_normal_axis_points(p1: point_3d, p2: point_3d) -> int: >>> axis_id = ec.create_normal_axis_points(axis_start_pt, axis_end_pt) Returns: - int + The id of the created normal axis. """ -def create_normal_axis_vectors(length: float, p1: point_3d, xl: point_3d) -> int: - """create normal axis vectors +def create_normal_axis_vectors(length: float, starting_point: point_3d, axis_direction: point_3d) -> ElementId: + """Creates a normal axis using vectors. Parameters: - length: length - p1: p1 - xl: xl + length: The length of the axis. + starting_point: The starting point of the axis. + axis_direction: The direction vector of the axis. Examples: >>> axis_length = 1500. @@ -1128,262 +1027,223 @@ def create_normal_axis_vectors(length: float, p1: point_3d, xl: point_3d) -> int >>> axis_id = ec.create_normal_axis_vectors(axis_length, axis_start_pt, axis_direction) Returns: - int + The id of the created normal axis. """ -def convert_bolt_to_standardconnector(elements: List[int], standard_element_name: str) -> None: - """convert bolt to standardconnector +def convert_bolt_to_standardconnector(element_id_list: List[ElementId], standard_element_name: str) -> None: + """Converts bolts to standard connectors. Parameters: - elements: elements - standard_element_name: standard_element_name - - Returns: - None + element_id_list: The list of bolts to convert. + standard_element_name: The name of the standard element. """ -def extrude_surface_to_auxiliary_vector(surface: int, vector: point_3d) -> int: - """extrude surface to auxiliary vector +def extrude_surface_to_auxiliary_vector(surface: ElementId, vector: point_3d) -> ElementId: + """Extrudes a surface to create an auxiliary element. Parameters: - surface: surface - vector: vector + surface: The surface to extrude. + vector: The vector to extrude along. Returns: - int + The id of the created auxiliary element. """ -def extrude_surface_to_panel_vector(surface: int, vector: point_3d) -> int: - """extrude surface to panel vector +def extrude_surface_to_panel_vector(surface: ElementId, vector: point_3d) -> ElementId: + """Extrudes a surface to create a panel element. Parameters: - surface: surface - vector: vector + surface: The surface to extrude. + vector: The vector to extrude along. Returns: - int + The id of the created panel element. """ -def extrude_surface_to_beam_vector(surface: int, vector: point_3d) -> int: - """extrude surface to beam vector +def extrude_surface_to_beam_vector(surface: ElementId, vector: point_3d) -> ElementId: + """Extrudes a surface to create a beam element. Parameters: - surface: surface - vector: vector + surface: The surface to extrude. + vector: The vector to extrude along. Returns: - int + The id of the created beam element. """ -def convert_container_to_container_block(elements: List[int]) -> None: - """convert container to container block +def convert_container_to_container_block(element_id_list: List[ElementId]) -> None: + """Converts a container to a container block. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to convert. """ -def create_bounding_box_local(reference_element: int, elements: List[int]) -> int: - """create bounding box local +def create_bounding_box_local(reference_element: ElementId, element_id_list: List[ElementId]) -> ElementId: + """Creates a local bounding box for a list of elements relative to a reference element. Parameters: - reference_element: reference_element - elements: elements + reference_element: The ID of the reference element. + element_id_list: The list of elements for which to create the bounding box. Returns: - int + The ID of the created bounding box element. """ -def create_bounding_box_global(elements: List[int]) -> int: - """create bounding box global +def create_bounding_box_global(element_id_list: List[ElementId]) -> ElementId: + """Creates a global bounding box for a list of elements. Parameters: - elements: elements + element_id_list: The list of elements for which to create the bounding box. Returns: - int + The ID of the created bounding box element. """ -def convert_auxiliary_to_panel(elements: List[int]) -> None: - """convert auxiliary to panel +def convert_auxiliary_to_panel(element_id_list: List[ElementId]) -> None: + """Converts auxiliary elements to panel. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to convert. """ -def convert_auxiliary_to_beam(elements: List[int]) -> None: - """convert auxiliary to beam +def convert_auxiliary_to_beam(element_id_list: List[ElementId]) -> None: + """Converts auxiliary elements to beams. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to convert. """ -def auto_set_rough_volume_situation(elements: List[int]) -> None: - """auto set rough volume situation +def auto_set_rough_volume_situation(element_id_list: List[ElementId]) -> None: + """Automatically sets the rough volume situation for a list of elements. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to process. """ -def rough_volume_situation_manual(cover: int, add_partner: List[int], remove_partner: List[int]) -> None: - """rough volume situation manual +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: - cover: cover - add_partner: add_partner - remove_partner: remove_partner - - Returns: - None + cover: The cover element ID. + add_partner: The list of partner element IDs to add. + remove_partner: The list of partner element IDs to remove. """ -def auto_set_parts_situation(elements: List[int]) -> None: - """auto set parts situation +def auto_set_parts_situation(element_id_list: List[ElementId]) -> None: + """Automatically sets the parts situation for a list of elements. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to process. """ -def parts_situation_manual(cover: int, add_childs: List[int], remove_childs: List[int]) -> None: - """parts situation manual +def parts_situation_manual(cover: ElementId, add_childs: List[ElementId], remove_childs: List[ElementId]) -> None: + """Manually sets the parts situation for a cover element. Parameters: - cover: cover - add_childs: add_childs - remove_childs: remove_childs - - Returns: - None + cover: The cover element ID. + add_childs: The list of child element IDs to add. + remove_childs: The list of child element IDs to remove. """ -def activate_rv_without_situation() -> List[int]: - """activate rv without situation +def activate_rv_without_situation() -> List[ElementId]: + """Activates the rough volume situation for elements without a situation. Returns: - List[int] + The list of IDs of the elements for which the rough volume situation was activated. """ -def activate_parts_without_situation() -> List[int]: - """activate parts without situation +def activate_parts_without_situation() -> List[ElementId]: + """Activates the parts situation for elements without a situation. Returns: - List[int] + The list of IDs of the elements for which the parts situation was activated. """ -def add_elements_to_detail(elements: List[int], detail: int) -> None: - """add elements to detail +def add_elements_to_detail(element_id_list: List[ElementId], detail: int) -> None: + """Adds elements to a detail. Parameters: - elements: The list of elements to be added to the detail - detail: The ID of the detail - - Returns: - None + element_id_list: The list of elements to be added to the detail. + detail: The ID of the detail. """ -def subtract_elements_with_undo(hard_elements: List[int], soft_elements: List[int], with_undo: bool) -> List[int]: - """subtract elements with undo +def subtract_elements_with_undo(hard_element_id_list: List[ElementId], soft_element_id_list: List[ElementId], with_undo: bool) -> List[ElementId]: + """Subtracts a list of "soft" elements from a list of "hard" elements with undo functionality. Parameters: - hard_elements: hard_elements - soft_elements: soft_elements - with_undo: with_undo + hard_element_id_list: The list of "hard" elements. + soft_element_id_list: The list of "soft" elements. + with_undo: Indicate whether the operation should be added to the undo stack. Returns: - List[int] + The list of elements resulting from the subtraction. """ -def create_linear_optimization(elements: List[int], optimization_number: int, total_length: float, start_cut: float, end_cut: float, saw_kerf: float, is_production_list: bool) -> int: +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: - elements: elements - optimization_number: optimization_number - total_length: total_length - start_cut: start_cut - end_cut: end_cut - saw_kerf: saw_kerf - is_production_list: is_production_list + element_id_list: The list of elements to be optimized. + optimization_number: The optimization number, nested parent element id. + total_length: The total length for the optimization. + start_cut: The start cut for the optimization. + end_cut: The end cut for the optimization. + saw_kerf: The saw kerf for the optimization. + is_production_list: A flag indicating if this is a production list. Returns: - int + The ID of the created linear optimization element. """ -def start_element_module_calculation_silently(covers: List[int]) -> None: - """start element module calculation silently +def start_element_module_calculation_silently(covers: List[ElementId]) -> None: + """Starts the calculation of the element module for a list of covers silently (without user interaction). Parameters: - covers: covers - - Returns: - None + covers: The list of covers for which to start the element module calculation. """ -def replace_physical_drillings_with_drilling_axes(elements: List[int], mininum_diameter: float, maximum_diameter: float) -> List[int]: - """replace physical drillings with drilling axes +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: - elements: elements - mininum_diameter: mininum_diameter - maximum_diameter: maximum_diameter + element_id_list: The list of elements to process. + mininum_diameter: The minimum diameter of the drilling. + maximum_diameter: The maximum diameter of the drilling. Returns: - List[int] + The list of IDs of the elements where the replacement was successful. """ -def cut_element_with_processing_group(soft_element: int, processing: int) -> None: - """cut element with processing group +def cut_element_with_processing_group(soft_element: ElementId, processing: ElementId) -> None: + """Cuts an element with a processing group. Parameters: - soft_element: soft_element - processing: processing - - Returns: - None + soft_element: The ID of the element to be cut. + processing: The ID of the processing group. """ -def add_element_to_detail(elements: List[int], detail: int) -> None: - """add element to detail +def add_element_to_detail(element_id_list: List[ElementId], detail: int) -> None: + """Adds elements to a detail. Parameters: - elements: elements - detail: detail - - Returns: - None + element_id_list: The list of elements to be added to the detail. + detail: The ID of the detail. """ -def convert_elements_to_auxiliary_elements(elements: List[int]) -> None: - """convert elements to auxiliary elements +def convert_elements_to_auxiliary_elements(element_id_list: List[ElementId]) -> None: + """Converts elements to auxiliary elements. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to be converted. """ -def create_circular_axis_points(diameter: float, p1: point_3d, p2: point_3d) -> int: - """create circular axis points +def create_circular_axis_points(diameter: float, first_point: point_3d, second_point: point_3d) -> ElementId: + """Creates a circular axis using points. Parameters: - diameter: diameter - p1: p1 - p2: p2 + diameter: The diameter of the circular axis. + first_point: The first point defining the axis. + second_point: The second point defining the axis. Examples: >>> axis_diameter = 50. @@ -1392,17 +1252,17 @@ def create_circular_axis_points(diameter: float, p1: point_3d, p2: point_3d) -> >>> circular_axis_id = ec.create_circular_axis_points(axis_diameter, axis_start_pt, axis_end_pt) Returns: - int + The ID of the created circular axis element. """ -def create_circular_axis_vector(diameter: float, length: float, p1: point_3d, xl: point_3d) -> int: - """create circular axis vector +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: - diameter: diameter - length: length - p1: p1 - xl: xl + diameter: The diameter of the circular axis. + length: The length of the circular axis. + starting_point: The starting point. + axis_direction: The direction of the X-axis. Examples: >>> axis_diameter = 60. @@ -1412,18 +1272,18 @@ def create_circular_axis_vector(diameter: float, length: float, p1: point_3d, xl >>> circular_axis_id = ec.create_circular_axis_vector(axis_diameter, axis_length, axis_start_pt, axis_direction) Returns: - int + The ID of the created circular axis element. """ -def create_polygon_panel(polygon_vertices: vertex_list, thickness: float, xl: point_3d, zl: point_3d) -> int: - """create polygon panel +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: - polygon_vertices: polygon_vertices - thickness: thickness - xl: xl - zl: zl + polygon_vertices: The vertices of the polygon. + thickness: The thickness of the panel. + x_local_direction: The X-axis direction of the panel. + z_local_direction: The Z-axis direction of the panel. Examples: >>> # Create a hexagonal panel @@ -1441,592 +1301,556 @@ def create_polygon_panel(polygon_vertices: vertex_list, thickness: float, xl: po >>> polygon_panel_id = ec.create_polygon_panel(vertices, panel_thickness, extrusion_vector, z_vector) Returns: - int + The ID of the created polygon panel element. """ -def cut_elements_with_overmeasure(hard_elements: List[int], soft_elements: List[int]) -> None: - """cut elements with overmeasure +def cut_elements_with_overmeasure(hard_element_id_list: List[ElementId], soft_element_id_list: List[ElementId]) -> None: + """Cuts elements with overmeasure. Parameters: - hard_elements: hard_elements - soft_elements: soft_elements - - Returns: - None + hard_element_id_list: The list of hard elements. + soft_element_id_list: The list of soft elements. """ -def cut_log_corner_joint(settings_name: str, elements: List[int]) -> None: - """cut log corner joint +def cut_log_corner_joint(settings_name: str, element_id_list: List[ElementId]) -> None: + """Cuts log corner joint. Parameters: - settings_name: settings_name - elements: elements - - Returns: - None + settings_name: The name of the settings to be used for the cut. + element_id_list: The list of elements to be cut. """ -def get_edge_selection(elements: List[int]) -> edge_list: - """get edge selection +def get_edge_selection(element_id_list: List[ElementId]) -> edge_list: + """Retrieves the edge selection of the provided elements. Parameters: - elements: elements + element_id_list: The list of element IDs. Returns: - edge_list + The list of edges selected. """ -def get_facets_with_lasso(elements: List[int]) -> facet_list: - """get facets with lasso +def get_facets_with_lasso(element_id_list: List[ElementId]) -> facet_list: + """Retrieves the facets of elements within a lasso selection. Parameters: - elements: elements + element_id_list: The list of elements to check for facets within the lasso selection. Returns: - facet_list + The list of facets selected. """ -def create_standard_element_from_guid_points(guid: str, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create standard element from guid points +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: - guid: guid - p1: p1 - p2: p2 - p3: p3 + guid: The GUID of the standard element. + first_point: The first point. + second_point: The second point. + third_point: The third point. Returns: - int + The id of the created standard element. """ -def create_standard_element_from_guid_vectors(guid: str, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create standard element from guid vectors +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: - guid: guid - length: length - p1: p1 - xl: xl - zl: zl + guid: The GUID of the standard element. + length: The length of the element. + starting_point: The starting point of the element. + x_local_direction: The X-axis direction vector. + z_local_direction: The Z-axis direction vector. Returns: - int + The ID of the created standard element. """ -def fillet_edge(element_id: int, edge_start: point_3d, edge_end: point_3d, radius: float) -> None: - """fillet edge +def fillet_edge(element_id: ElementId, edge_start: point_3d, edge_end: point_3d, radius: float) -> None: + """Fillet an edge of an element. Parameters: - element_id: element_id - edge_start: edge_start - edge_end: edge_end - radius: radius - - Returns: - None + element_id: The element id. + edge_start: The start point of the edge. + edge_end: The end point of the edge. + radius: The radius of the fillet. """ -def chamfer_edge(element_id: int, edge_start: point_3d, edge_end: point_3d, length: float) -> None: - """chamfer edge +def chamfer_edge(element_id: ElementId, edge_start: point_3d, edge_end: point_3d, length: float) -> None: + """Chamfers an edge of an element. Parameters: - element_id: element_id - edge_start: edge_start - edge_end: edge_end - length: length - - Returns: - None + element_id: The element id. + edge_start: The start point of the edge. + edge_end: The end point of the edge. + length: The length of the chamfer. """ -def convert_drilling_to_circular_beam(elements: List[int]) -> None: - """convert drilling to circular beam +def convert_drilling_to_circular_beam(element_id_list: List[ElementId]) -> None: + """Converts drilling to circular beam. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of element IDs to convert. """ -def convert_lines_to_surfaces(elements: List[int]) -> List[int]: - """convert lines to surfaces +def convert_lines_to_surfaces(element_id_list: List[ElementId]) -> List[ElementId]: + """Converts lines to surfaces. Parameters: - elements: elements + element_id_list: The list of element IDs to convert. Returns: - List[int] + The list of element IDs that were converted. """ -def convert_surfaces_to_volume(elements: List[int]) -> int: - """convert surfaces to volume +def convert_surfaces_to_volume(element_id_list: List[ElementId]) -> ElementId: + """Converts surfaces to volume. Parameters: - elements: elements + element_id_list: The list of element IDs to convert. Returns: - int + The ID of the created volume element. """ -def cut_corner_lap(elements: List[int], depth: float, clearance_base: float, clearance_side: float, backcut: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut corner lap +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: - elements: elements - depth: depth - clearance_base: clearance_base - clearance_side: clearance_side - backcut: backcut - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + depth: The vertical depth of the lap cut applied to each element. + clearance_base: Additional clearance applied at the bottom (base) of the lap cut for fitting tolerance. + clearance_side: Additional clearance on the side faces of the cut to prevent tight joints or interference. + backcut: A small offset or undercut applied to the outer face of the cut to improve fit or reduce friction. + drilling_count: The number of drill holes to create for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def cut_t_lap(elements: List[int], depth: float, clearance_base: float, clearance_side: float, backcut: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut t lap +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: - elements: elements - depth: depth - clearance_base: clearance_base - clearance_side: clearance_side - backcut: backcut - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + depth: The vertical depth of the cut where the intersecting element will be placed. + clearance_base: Additional clearance at the base (bottom) of the cut to ensure a proper fit. + clearance_side: Additional clearance on the side faces of the cut to avoid tight fitting. + backcut: A small offset or undercut applied inward to improve fitting during assembly. + drilling_count: The number of drill holes to create for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def cut_cross_lap(elements: List[int], depth: float, clearance_base: float, clearance_side: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut cross lap +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: - elements: elements - depth: depth - clearance_base: clearance_base - clearance_side: clearance_side - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + depth: The vertical depth of the cross-lap cut, typically half the thickness of the material. + clearance_base: Additional clearance at the bottom of the cut to ensure a proper fit between intersecting elements. + clearance_side: Additional clearance on the side walls of the cut to prevent tight fits or friction. + drilling_count: The number of drill holes to create for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def delete_processes_keep_cutting_bodies(elements: List[int], keep_cutting_elements_only: bool) -> List[int]: - """delete processes keep cutting bodies +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: - elements: elements - keep_cutting_elements_only: keep_cutting_elements_only + element_id_list: The list of elements to be processed. + keep_cutting_elements_only: True if the return element id contains only cutting elements, false otherwise. Returns: - List[int] + The id list of all removed geometry, cuttings bodies. """ -def cut_double_tenon(elements: List[int], depth1: float, depth2: float, clearance: float, backcut: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut double tenon +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: - elements: elements - depth1: depth1 - depth2: depth2 - clearance: clearance - backcut: backcut - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + depth1: The depth of the first tenon shoulder. + depth2: The depth of the second tenon shoulder. + clearance: Additional clearance applied around the tenons for fitting tolerance during assembly. + backcut: A small undercut or inward offset to ensure the tenons fit without surface interference. + drilling_count: The number of drill holes to create for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + 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: int, nesting_child_id: int) -> 'coordinate_system_data': - """get coordinate system data nesting child +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: - nesting_parent_id: nesting_parent_id - nesting_child_id: nesting_child_id + nesting_parent_id: The nesting parent id. + nesting_child_id: The nesting child id. Returns: - coordinate_system_data + 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(elements: List[int], length: float, clearance_length: float, clearance_depth: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut half lap +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: - elements: elements - length: length - clearance_length: clearance_length - clearance_depth: clearance_depth - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + length: The length of the half-lap joint along the main axis of the elements. + clearance_length: Additional clearance along the length of the cut to ensure proper fitting. + clearance_depth: Additional clearance in the depth direction to avoid tight joints or surface interference. + drilling_count: The number of drill holes to create for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def cut_simple_scarf(elements: List[int], length: float, depth: float, clearance_length: float, clearance_depth: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut simple scarf +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: - elements: elements - length: length - depth: depth - clearance_length: clearance_length - clearance_depth: clearance_depth - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + length: The distance between the two starting points of the cut. + depth: The vertical depth of the initial straight cut before the diagonal cut begins. + clearance_length: The additional length clearance applied along the initial (depth) cut. + clearance_depth: The additional depth clearance applied along the diagonal cut. + drilling_count: The number of drill holes to be created for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: The tolerance applied to the hole size, typically for fitting the bolt head or allowing easier assembly. """ -def cut_diagonal_cut(elements: List[int], length: float, clearance_length: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut diagonal cut +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: - elements: elements - length: length - clearance_length: clearance_length - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to be cut. + length: The total length of the diagonal cut applied along the element. + clearance_length: Additional clearance along the cut length to ensure proper fitting between elements. + drilling_count: The number of drill holes to create for fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: The tolerance applied to the hole size for bolt head clearance or easier insertion. """ -def get_all_identifiable_element_ids() -> List[int]: - """get all identifiable element ids +def get_all_identifiable_element_ids() -> List[ElementId]: + """Retrieves a list of all identifiable elements. Returns: - List[int] + A list of all identifiable element IDs. """ -def get_visible_identifiable_element_ids() -> List[int]: - """get visible identifiable element ids +def get_visible_identifiable_element_ids() -> List[ElementId]: + """Get a list of all visible identifiable elements. Returns: - List[int] + A list of IDs of all visible identifiable elements. """ -def get_invisible_identifiable_element_ids() -> List[int]: - """get invisible identifiable element ids +def get_invisible_identifiable_element_ids() -> List[ElementId]: + """Get a list of all invisible identifiable elements. Returns: - List[int] + A list of IDs of all invisible identifiable elements. """ -def get_active_identifiable_element_ids() -> List[int]: - """get active identifiable element ids +def get_active_identifiable_element_ids() -> List[ElementId]: + """Get a list of all active identifiable elements. Returns: - List[int] + A list of IDs of all active identifiable elements. """ -def get_inactive_all_identifiable_element_ids() -> List[int]: - """get inactive all identifiable element ids +def get_inactive_all_identifiable_element_ids() -> List[ElementId]: + """Get a list of all inactive identifiable elements. Returns: - List[int] + A list of IDs of all inactive identifiable elements. """ -def get_inactive_visible_identifiable_element_ids() -> List[int]: - """get inactive visible identifiable element ids +def get_inactive_visible_identifiable_element_ids() -> List[ElementId]: + """Get a list of all inactive visible identifiable elements. Returns: - List[int] + A list of IDs of all inactive visible identifiable elements. """ -def check_if_point_is_in_element(point: point_3d, element_id: int) -> bool: - """check if point is in element +def check_if_point_is_in_element(point: point_3d, element_id: ElementId) -> bool: + """Check if a point is inside an element. Parameters: - point: point - element_id: element_id + point: The point to check. + element_id: The ID of the element to check against. Returns: - bool + True if the point is inside the element, false otherwise. """ -def check_if_point_is_on_element(point: point_3d, element_id: int) -> bool: - """check if point is on element +def check_if_point_is_on_element(point: point_3d, element_id: ElementId) -> bool: + """Check if a point is on the surface of an element. Parameters: - point: point - element_id: element_id + point: The point to check. + element_id: The ID of the element to check against. Returns: - bool + True if the point is on the surface of the element, false otherwise. """ -def get_element_contact_facets(first_id: int, second_id: int) -> facet_list: - """get element contact facets +def get_element_contact_facets(first_id: ElementId, second_id: ElementId) -> facet_list: + """Retrieves the contact facets between two elements. Parameters: - first_id: first_id - second_id: second_id + first_id: The ID of the first element. + second_id: The ID of the second element. Returns: - facet_list + The list of contact facets between the two elements. """ -def get_element_raw_interface_vertices(first_id: int, second_id: int) -> List[point_3d]: - """get element raw interface vertices +def get_element_raw_interface_vertices(first_id: ElementId, second_id: ElementId) -> List[point_3d]: + """Get the raw interface vertices between two elements. Parameters: - first_id: first_id - second_id: second_id + first_id: The ID of the first element. + second_id: The ID of the second element. Returns: - List[point_3d] + The list of raw interface vertices between the two elements. """ def get_standard_export_solid_list() -> List[str]: - """get standard export solid list + """Retrieves a list of standard export solid names. Returns: - List[str] + The list of standard export solid names. """ def get_standard_container_list() -> List[str]: - """get standard container list + """Retrieves a list of standard container names. Returns: - List[str] + The list of standard container names. """ def get_standard_beam_list() -> List[str]: - """get standard beam list + """Retrieves a list of standard beam names. Returns: - List[str] + The list of standard beam names. """ def get_standard_panel_list() -> List[str]: - """get standard panel list + """Retrieves a list of standard panel names. Returns: - List[str] + The list of standard panel names. """ -def get_variant_sibling_element_ids(element_id: int) -> List[int]: - """get variant sibling element ids +def get_variant_sibling_element_ids(element_id: ElementId) -> List[ElementId]: + """Retrieves a list of variant sibling element IDs. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of variant sibling element IDs. """ -def get_reference_element(element: int) -> int: - """get reference element +def get_reference_element(element_id: ElementId) -> ElementId: + """Get the reference element for a given element. Parameters: - element: element + element_id: The element id. Returns: - int + The reference element ID. """ -def get_element_contact_vertices(first_id: int, second_id: int) -> List[point_3d]: - """get element contact vertices +def get_element_contact_vertices(first_id: ElementId, second_id: ElementId) -> List[point_3d]: + """Get the contact vertices between two elements. Parameters: - first_id: first_id - second_id: second_id + first_id: The ID of the first element. + second_id: The ID of the second element. Returns: - List[point_3d] + The list of contact vertices between the two elements. """ -def get_nesting_parent_id(element_id: int) -> int: - """get nesting parent id +def get_nesting_parent_id(element_id: ElementId) -> ElementId: + """Get the parent ID of a nested element. Parameters: - element_id: element_id + element_id: The element id. Returns: - int + The ID of the parent element. """ -def check_if_elements_are_in_collision(first_element_id: int, second_element_id: int) -> bool: - """check if elements are in collision +def check_if_elements_are_in_collision(first_element_id: ElementId, second_element_id: ElementId) -> bool: + """Check if two elements are in collision. Parameters: - first_element_id: first_element_id - second_element_id: second_element_id + first_element_id: The ID of the first element. + second_element_id: The ID of the second element. Returns: - bool + True if the elements are in collision, false otherwise. """ -def check_if_elements_are_in_contact(first_element_id: int, second_element_id: int) -> bool: - """check if elements are in contact +def check_if_elements_are_in_contact(first_element_id: ElementId, second_element_id: ElementId) -> bool: + """Check if two elements are in contact. Parameters: - first_element_id: first_element_id - second_element_id: second_element_id + first_element_id: The ID of the first element. + second_element_id: The ID of the second element. Returns: - bool + True if the elements are in contact, false otherwise. """ -def get_element_module_properties_for_element(element_id: int) -> element_module_properties: - """get element module properties for element +def get_element_module_properties_for_element(element_id: ElementId) -> element_module_properties: + """Retrieves the module properties for a specific element. Parameters: - element_id: element_id + element_id: The element id. Returns: - element_module_properties + The module properties of the element. """ -def get_element_type_description(element_id: int) -> str: - """get element type description +def get_element_type_description(element_id: ElementId) -> str: + """Retrieves the type description of a specific element. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The type description of the element. """ -def get_opening_variant_ids(elements: List[int], opening_type: int) -> List[int]: - """get opening variant ids +def get_opening_variant_ids(element_id_list: List[ElementId], opening_type: int) -> List[int]: + """Get the opening variant IDs for a list of elements. Parameters: - elements: elements - opening_type: opening_type + element_id_list: The list of element IDs. + opening_type: The type of opening to check for. Unknown = 0, Window = 1, Door = 2. Returns: - List[int] + The list of opening variant IDs. """ -def get_parent_container_id(element_id: int) -> int: - """get parent container id +def get_parent_container_id(element_id: ElementId) -> ElementId: + """Get the parent container ID of a nested element. Parameters: - element_id: element_id + element_id: The element id. Returns: - int + The ID of the parent element. """ -def get_export_solid_content_elements(element_id: int) -> List[int]: - """get export solid content elements +def get_export_solid_content_elements(element_id: ElementId) -> List[ElementId]: + """Get the content elements of an export solid. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of content elements. """ -def get_container_content_elements(element_id: int) -> List[int]: - """get container content elements +def get_container_content_elements(element_id: ElementId) -> List[ElementId]: + """Get the content elements of a container. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of content elements. """ def get_element_detail_path() -> str: - """get element detail path + """Get the detail path of the element module. Returns: - str + The detail path of the element module. """ -def get_element_cadwork_guid(element_id: int) -> str: - """get element cadwork guid +def get_element_cadwork_guid(element_id: ElementId) -> str: + """Get the Cadwork GUID of a specific element. Parameters: - element_id: element_id + element_id: The element id. Returns: - str + The Cadwork GUID of the element. """ -def get_bounding_box_vertices_local(reference_element: int, elements: List[int]) -> List[point_3d]: - """get bounding box vertices local +def get_bounding_box_vertices_local(reference_element: ElementId, element_id_list: List[ElementId]) -> List[point_3d]: + """Retrieves the local bounding box vertices for a list of elements relative to a reference element. Parameters: - reference_element: reference_element - elements: elements + reference_element: The ID of the reference element. + element_id_list: The list of elements for which to retrieve the bounding box vertices. Returns: - List[point_3d] + The list of vertices representing the local bounding box of the elements. """ -def get_bounding_box_vertices_global(elements: List[int]) -> List[point_3d]: - """get bounding box vertices global +def get_bounding_box_vertices_global(element_id_list: List[ElementId]) -> List[point_3d]: + """Get the global bounding box vertices for a list of elements. Parameters: - elements: elements + element_id_list: The list of elements for which to retrieve the bounding box vertices. Returns: - List[point_3d] + The list of vertices representing the global bounding box of the elements. """ -def get_all_nesting_raw_parts() -> List[int]: - """get all nesting raw parts +def get_all_nesting_raw_parts() -> List[ElementId]: + """Get a list of all raw parts in a nesting operation. Returns: - List[int] + The list of IDs of all raw parts in a nesting operation. """ -def get_joined_elements(element_id: int) -> List[int]: - """get joined elements +def get_joined_elements(element_id: ElementId) -> List[ElementId]: + """Retrieves the IDs of elements that have been joined with the specified element. Parameters: - element_id: element_id + element_id: The element id. Returns: - List[int] + The list of IDs of the joined elements. """ -def check_element_duplicates(elements: List[int]) -> List[int]: - """check element duplicates +def check_element_duplicates(element_id_list: List[ElementId]) -> List[ElementId]: + """Checks for duplicate elements in the provided list. Parameters: - elements: elements + element_id_list: The list of element IDs to check for duplicates. Returns: - List[int] + The list of duplicate elements. """ -def get_elements_in_contact(element: int) -> List[int]: - """get elements in contact +def get_elements_in_contact(element_id: ElementId) -> List[ElementId]: + """Retrieves a list of elements in contact with a specific element. Parameters: - element: element + element_id: The ID of the element to check for contact. Returns: - List[int] + The list of IDs of the elements in contact with the specified element. """ -def create_text_object_with_options(position: point_3d, xl: point_3d, zl: point_3d, text_options: text_object_options) -> int: - """create text object with options +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: - position: position - xl: xl - zl: zl - text_options: text_options + position: The position of the text object. + x_local_direction: The X-axis direction of the text object. + z_local_direction: The Z-axis direction of the text object. + text_options: The options for the text object. Examples: >>> text_position = cadwork.point_3d(0., 0., 0.) @@ -2040,165 +1864,135 @@ def create_text_object_with_options(position: point_3d, xl: point_3d, zl: point_ >>> text_id = ec.create_text_object_with_options(text_position, x_direction, z_direction, options) Returns: - int + The ID of the created text object. """ -def convert_surfaces_to_roof_surfaces(elements: List[int], roof_name: str) -> None: - """convert surfaces to roof surfaces +def convert_surfaces_to_roof_surfaces(element_id_list: List[ElementId], roof_name: str) -> None: + """Converts surfaces to roof surfaces. Parameters: - elements: elements - roof_name: roof_name - - Returns: - None + element_id_list: The list of elements to convert. + roof_name: The name of the roof surface. """ -def start_standard_element_dialog(standard_element_type: None) -> str: - """start standard element dialog +def start_standard_element_dialog(standard_element_type: standard_element_type) -> str: + """Starts the standard element dialogue based on the chosen element type. Parameters: - standard_element_type: standard_element_type + standard_element_type: The type of the standard element to create. Returns: - str + The GUID of the selected standard element if the item is valid, else null. """ def remove_standard_connector_axis(guid: str) -> None: - """remove standard connector axis + """Removes a standard connector axis. Parameters: - guid: guid - - Returns: - None + guid: The unique identifier of the standard connector axis to be removed. """ def remove_standard_beam(guid: str) -> None: - """remove standard beam + """Removes a standard beam. Parameters: - guid: guid - - Returns: - None + guid: The unique identifier of the standard connector axis to be removed. """ def remove_standard_panel(guid: str) -> None: - """remove standard panel + """Removes a standard panel. Parameters: - guid: guid - - Returns: - None + guid: The unique identifier of the standard panel to be removed. """ def remove_standard_container(guid: str) -> None: - """remove standard container + """Removes a standard container. Parameters: - guid: guid - - Returns: - None + guid: The unique identifier of the standard container to be removed. """ def remove_standard_export_solid(guid: str) -> None: - """remove standard export solid + """Removes a standard export solid. Parameters: - guid: guid - - Returns: - None + guid: The unique identifier of the standard export solid to be removed. """ -def get_user_element_ids_with_count(count: int) -> List[int]: - """get user element ids with count +def get_user_element_ids_with_count(count: int) -> List[ElementId]: + """Retrieves a list of user element IDs. Parameters: - count: count + count: The maximal number of elements to select. Returns: - List[int] + The list of user element IDs. """ -def cut_scarf_straight(elements: List[int], length: float, depth: float, clearance_length: float, clearance_depth: float, clearance_hook: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut scarf straight +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: - elements: elements - length: length - depth: depth - clearance_length: clearance_length - clearance_depth: clearance_depth - clearance_hook: clearance_hook - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements to apply the scarf cut to. + length: The total length of the scarf joint cut, measured along the element’s longitudinal axis. + depth: The depth of the vertical cut where both side join. + clearance_length: Additional clearance along the length direction to ensure proper fitting of the joint. + clearance_depth: Additional clearance in the depth direction to avoid tight fits or interference. + clearance_hook: Clearance added specifically at the hook or notch feature of the joint, if any. + drilling_count: The number of holes to be drilled, typically for bolts, pegs, or dowels to reinforce the joint. + drilling_diameter: The diameter of each drilled hole. + drilling_tolerance: The tolerance added to the hole size for easier assembly or bolt head fitting. """ -def cut_scarf_diagonal(elements: List[int], length: float, depth: float, clearance_length: float, clearance_depth: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut scarf diagonal +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: - elements: elements - length: length - depth: depth - clearance_length: clearance_length - clearance_depth: clearance_depth - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements on which the diagonal scarf cut will be applied. + length: The total length of the scarf joint measured along the element’s axis. + depth: The vertical depth of the initial straight section before the diagonal cut begins. + clearance_length: Additional clearance along the length direction to facilitate proper fitting of the joint. + clearance_depth: Additional clearance along the depth direction to avoid tight joints or misalignment. + drilling_count: The number of drill holes for mechanical fasteners (e.g., bolts or dowels). + drilling_diameter: The diameter of each drill hole. + drilling_tolerance: Tolerance added to the hole diameter for ease of insertion or head fit. """ -def cut_scarf_with_wedge(elements: List[int], length: float, depth: float, clearance_length: float, clearance_depth: float, wedge_width: float, drilling_count: int, drilling_diameter: float, drilling_tolerance: float) -> None: - """cut scarf with wedge +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: - elements: elements - length: length - depth: depth - clearance_length: clearance_length - clearance_depth: clearance_depth - wedge_width: wedge_width - drilling_count: drilling_count - drilling_diameter: drilling_diameter - drilling_tolerance: drilling_tolerance - - Returns: - None + element_id_list: The list of elements on which to apply the scarf-with-wedge cut. + length: The total length of the scarf joint, measured along the main axis of the element. + depth: The vertical depth of the straight portion of the cut before the diagonal section. + clearance_length: Additional clearance along the length direction for proper fit of the joint. + clearance_depth: Additional clearance in the depth direction to avoid interference. + wedge_width: The width of the wedge feature inserted or carved as part of the joint geometry. + drilling_count: The number of drill holes used to secure the joint (e.g., for bolts, pegs, or dowels). + drilling_diameter: The diameter of the drilled holes. + drilling_tolerance: Tolerance applied to the hole size, often used for easier bolt fitting or head clearance. """ -def cut_beam_end_profile(elements: List[int], profile_name: str, on_start_face: bool, on_end_face: bool) -> None: - """cut beam end profile +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: - elements: elements - profile_name: profile_name - on_start_face: on_start_face - on_end_face: on_end_face - - Returns: - None + element_id_list: The list of elements to modify. + profile_name: The name of the profile to add. + on_start_face: Cut on the start face? + on_end_face: Cut on the end face? """ -def create_truncated_cone_beam_points(start_diameter: float, end_diameter: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int: - """create truncated cone beam points +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: - start_diameter: start_diameter - end_diameter: end_diameter - p1: p1 - p2: p2 - p3: p3 + start_diameter: The starting diameter of the beam. + end_diameter: The ending diameter of the beam. + first_point: The first point. + second_point: The second point. + third_point: The third point. Examples: >>> start_dia = 200. @@ -2213,19 +2007,19 @@ def create_truncated_cone_beam_points(start_diameter: float, end_diameter: float >>> cone_id = ec.create_truncated_cone_beam_points(start_dia, end_dia, cone_start_pt, cone_end_pt, orientation_pt) Returns: - int + The ID of the created beam. """ -def create_truncated_cone_beam_vectors(start_diameter: float, end_diameter: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int: - """create truncated cone beam vectors +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: - start_diameter: start_diameter - end_diameter: end_diameter - length: length - p1: p1 - xl: xl - zl: zl + start_diameter: The starting diameter of the beam. + end_diameter: The ending diameter of the beam. + length: The length of the beam. + starting_point: The starting point. + x_local_direction: The direction of the X-axis. + z_local_direction: The direction of the Z-axis. Examples: >>> start_dia = 120. @@ -2237,15 +2031,15 @@ def create_truncated_cone_beam_vectors(start_diameter: float, end_diameter: floa >>> cone_id = ec.create_truncated_cone_beam_vectors(start_dia, end_dia, cone_length, origin_point, x_direction, z_direction) Returns: - int + The ID of the created beam. """ -def create_spline_line(spline_points: vertex_list) -> int: - """create spline line +def create_spline_line(spline_points: vertex_list) -> ElementId: + """Creates a spline line. Parameters: - spline_points: spline_points + spline_points: The points defining the spline. Examples: >>> # Create a spline through multiple points @@ -2257,94 +2051,51 @@ def create_spline_line(spline_points: vertex_list) -> int: >>> spline_id = ec.create_spline_line(points) Returns: - int + The ID of the created spline. """ -def unjoin_elements(element_id_list: List[int]) -> bool: - """unjoin elements +def unjoin_elements(element_id_list: List[ElementId]) -> bool: + """Unjoins the specified elements. Parameters: - element_id_list: element_id_list + element_id_list: The element id list. Returns: - bool + True if the operation was successful, false if an error occured. """ -def unjoin_top_level_elements(element_id_list: List[int]) -> bool: - """unjoin top level elements +def unjoin_top_level_elements(element_id_list: List[ElementId]) -> bool: + """Unjoins the specified top-level elements. Parameters: - element_id_list: element_id_list + element_id_list: The element id list. Returns: - bool + True if the operation was successful, false if an error occured. """ def set_element_group_single_select_mode() -> None: - """set element group single select mode - - Returns: - None + """ Switches the current element group selection mode so that single elements of a group are selectable. """ def set_element_group_multi_select_mode() -> None: - """set element group multi select mode - - Returns: - None + """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(elements: List[int]) -> None: - """convert circular beam to drilling +def convert_circular_beam_to_drilling(element_id_list: List[ElementId]) -> None: + """Converts circular beams to drillings. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of element IDs to convert. """ -def slice_elements_with_plane_and_get_new_elements(element: int, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> List[int]: - """slice elements with plane and get new elements +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: - element: The ID of the element to be sliced - cut_plane_normal_vector: The normal vector of the cutting plane - distance_from_global_origin: list of IDs of the new elements created by the slicing operation - - Returns: - List[int] - """ - -def get_elements_in_collision(element: int) ->List[int]: - """get elements in collision - - Parameters: - element: element - - Returns: - List[int] - """ - -def get_text_object_options(element: int) ->'text_object_options': - """get text object options - - Parameters: - element: element - - Returns: - text_object_options - """ - -def get_is_element_group_single_select_mode() ->bool: - """get is element group single select mode - - Returns: - bool - """ - -def get_is_element_group_multi_select_mode() ->bool: - """get is element group multi select mode + element_id: The ID of the element to be sliced. + cut_plane_normal_vector: The normal vector of the cutting plane. + distance_from_global_origin: The distance from the global origin to the cutting plane. Examples: >>> import math @@ -2367,93 +2118,109 @@ def get_is_element_group_multi_select_mode() ->bool: >>> print(f"Test point is on plane: {on_plane}") >>> # Slice the beam at the midpoint and get the resulting pieces >>> new_element_ids = ec.slice_elements_with_plane_and_get_new_elements(beam_id, plane_normal, distance) - >>> print(f"Created {len(new_element_ids)} new elements: {new_element_ids}") + >>> print(f"Created {len(new_element_ids)} new element_id_list: {new_element_ids}") >>> # Visualization: different pen colors for the new elements >>> for i, new_id in enumerate(new_element_ids): ... vc.set_color([new_id], i+5) Returns: - bool + The list of IDs of the new elements created by the slicing operation. """ - -def set_shoulder_options(options: shoulder_options) -> None: - """set shoulder options +def get_elements_in_collision(element_id: ElementId) -> List[ElementId]: + """Retrieves a list of elements in collision with a specific element. Parameters: - options: options + element_id: The ID of the element to check for collision. Returns: - None + A list of IDs of the elements in collision with the specified element. """ - -def set_heel_shoulder_options(options: heel_shoulder_options) -> None: - """set heel shoulder 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: - options: options + element_id: The ID of the element to retrieve options for. Returns: - None + The text object options for the specified element. """ +def get_is_element_group_single_select_mode() ->bool: + """Gets whether the current element group selection mode is setup to select single elements. -def set_double_shoulder_options(options: double_shoulder_options) -> None: - """set double shoulder options + Returns: + True if the current element group selection mode is set to single select, false otherwise. + """ - Parameters: - options: options +def get_is_element_group_multi_select_mode() ->bool: + """Gets whether the current element group selection mode is setup to select multiple elements. Returns: - None + True if the current element group selection mode is set to multi select, false otherwise. """ -def cut_shoulder(element_id_list: List[int], connecting_element_id_list: - List[int]) ->None: - """cut shoulder + +def set_shoulder_options(options: shoulder_options) -> None: + """Sets the shoulder cut options. Parameters: - element_id_list: element_id_list - connecting_element_id_list: connecting_element_id_list + options: The shoulder options to set. + """ - Returns: - None + +def set_heel_shoulder_options(options: heel_shoulder_options) -> None: + """Sets the heel shoulder cut options. + + Parameters: + options: The heel shoulder options to set. """ -def cut_heel_shoulder(element_id_list: List[int], - connecting_element_id_list: List[int]) ->None: - """cut heel shoulder + +def set_double_shoulder_options(options: double_shoulder_options) -> None: + """Sets the double shoulder cut options. Parameters: - element_id_list: element_id_list - connecting_element_id_list: connecting_element_id_list + options: The double shoulder options to set. + """ - Returns: - None +def cut_shoulder(element_id_list: List[ElementId], connecting_element_id_list: + List[ElementId]) ->None: + """Cuts shoulder with current 3D options. + + Parameters: + element_id_list: The 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_double_shoulder(element_id_list: List[int], - connecting_element_id_list: List[int]) ->None: - """cut double shoulder +def cut_heel_shoulder(element_id_list: List[ElementId], + connecting_element_id_list: List[ElementId]) ->None: + """Cuts heel with current 3D options Parameters: - element_id_list: element_id_list - connecting_element_id_list: connecting_element_id_list + element_id_list: The 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. + """ - Returns: - 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: + element_id_list: The 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 filter_elements(elements: List[int], element_filter: element_filter) -> List[int]: - """filter elements +def filter_elements(element_id_list: List[ElementId], element_filter: element_filter) -> List[ElementId]: + """Filters a list of elements based on a provided filter. Parameters: - elements: elements - element_filter: name_filter + element_id_list: The list of elements to filter. + element_filter: The filter to apply to the list of elements. - Example: + Examples: >>> import cadwork >>> import element_controller as ec >>> your_element_filter = cadwork.element_filter() @@ -2462,16 +2229,16 @@ def filter_elements(elements: List[int], element_filter: element_filter) -> List >>> print(filtered_elements) Returns: - List[int] + The filtered list of element IDs. """ -def map_elements(elements: List[int], map_query: element_map_query) -> Dict[str, List[int]]: - """map elements +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. Parameters: - elements: elements - map_query: map_query + element_id_list: The list of elements to map. + map_query: The map query to apply to the list of elements. Examples: >>> import cadwork @@ -2482,18 +2249,19 @@ def map_elements(elements: List[int], map_query: element_map_query) -> Dict[str, >>> print(mapped_items) Returns: - Dict[str, List[int]] + The map of elements that pass the map query. """ -def cast_ray_and_get_element_intersections(elements: List[int], ray_start_position: point_3d, +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: - """cast ray and get element intersections + """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: - elements: elements - ray_start_position: ray_start_position - ray_end_position: ray_end_position - radius: radius + element_id_list: List of element IDs to test against the ray. + ray_start_position: 3D start point of the ray. + ray_end_position: 3D end point of the ray. + radius: Radius of the ray cylinder (allows testing against a volume rather than just a line). Examples: >>> import element_controller as ec @@ -2508,5 +2276,5 @@ def cast_ray_and_get_element_intersections(elements: List[int], ray_start_positi >>> ec.create_node(pos) Returns: - hit_result + Contains list of elements that were hit by the ray and list of vertices that are queried via ElementID. """ From 025414cb102ba3c21639009ee999f9e3da87459e Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 10:53:48 +0200 Subject: [PATCH 15/30] [API-519] Improved the endtype controller documentation --- src/endtype_controller/__init__.pyi | 191 +++++++++++++--------------- 1 file changed, 87 insertions(+), 104 deletions(-) diff --git a/src/endtype_controller/__init__.pyi b/src/endtype_controller/__init__.pyi index 4729b48..bc7b5e5 100644 --- a/src/endtype_controller/__init__.pyi +++ b/src/endtype_controller/__init__.pyi @@ -1,20 +1,21 @@ from typing import List +from cadwork.api_types import * def get_last_error(error_code: int) -> str: - """get last error + """Gets the last error message. Parameters: - error_code: error_code + error_code: A pointer to an integer where the error code will be stored. Returns: - str + A string containing the last error message. """ -def get_endtype_id(name: str) -> int: - """Gets the endtypeID by endtypename +def get_endtype_id(name: str) -> EndtypeId: + """Gets the endtype id by endtype name. Parameters: - name: name + name: The endtype name. Examples: >>> import endtype_controller as etc @@ -24,14 +25,14 @@ def get_endtype_id(name: str) -> int: >>> print(f"Endtype ID: {endtype_id}") Returns: - int + The wanted endtype id. """ -def get_endtype_id_start(element_id: int) -> int: - """Gets the endtypeID of the start face +def get_endtype_id_start(element_id: ElementId) -> EndtypeId: + """Gets the endtype id of the start face. Parameters: - element_id: element_id + element_id: The element id. Examples: >>> import element_controller as ec @@ -43,14 +44,14 @@ def get_endtype_id_start(element_id: int) -> int: >>> print(f"Start endtype ID: {start_endtype_id}") Returns: - int + The wanted endtype id. """ -def get_endtype_id_end(element_id: int) -> int: - """Gets the endtypeID of the end face +def get_endtype_id_end(element_id: ElementId) -> EndtypeId: + """Gets the endtype id of the end face. Parameters: - element_id: element_id + element_id: The element id. Examples: >>> import element_controller as ec @@ -62,16 +63,16 @@ def get_endtype_id_end(element_id: int) -> int: >>> print(f"End endtype ID: {end_endtype_id}") Returns: - int + The wanted endtype id. """ -def get_endtype_id_facet(element_id: int, face_number: int) -> int: - """get endtype id facet +def get_endtype_id_facet(element_id: ElementId, face_number: int) -> EndtypeId: + """Gets the endtype id of a face with the face number. Parameters: - element_id: element_id - face_number: face_number + element_id: The element id. + face_number: The face number. 0 <= aFaceNumber < element face count. Note: Endtypes can only be set on faces that are placed at start or end points. @@ -88,15 +89,15 @@ def get_endtype_id_facet(element_id: int, face_number: int) -> int: >>> print(f"Facet endtype ID: {facet_endtype_id}") Returns: - int + The wanted endtype id. """ -def set_endtype_name_start(element_id: int, name: str) -> None: - """Sets the endtype to start face by endtypename +def set_endtype_name_start(element_id: ElementId, name: str) -> None: + """Sets the endtype to start face by endtype name. Parameters: - element_id: element_id - name: name + element_id: The element id. + name: The endtype name. Examples: >>> import element_controller as ec @@ -106,17 +107,14 @@ def set_endtype_name_start(element_id: int, name: str) -> None: >>> element = selected_elements[0] >>> endtype_name = "Tenon_100x50" >>> etc.set_endtype_name_start(element, endtype_name) - - Returns: - None """ -def set_endtype_name_end(element_id: int, name: str) -> None: - """Sets the endtype to end face by endtypename +def set_endtype_name_end(element_id: ElementId, name: str) -> None: + """Sets the endtype to end face by endtype name. Parameters: - element_id: element_id - name: name + element_id: The element id. + name: The endtype name. Examples: >>> import element_controller as ec @@ -126,19 +124,16 @@ def set_endtype_name_end(element_id: int, name: str) -> None: >>> element = selected_elements[0] >>> endtype_name = "Mortise_100x50" >>> etc.set_endtype_name_end(element, endtype_name) - - Returns: - None """ -def set_endtype_name_facet(element_id: int, name: str, face_number: int) -> None: - """set endtype name facet +def set_endtype_name_facet(element_id: ElementId, name: str, face_number: int) -> None: + """Sets the endtype to a face by endtype name. Parameters: - element_id: element_id - name: name - face_number: face_number + element_id: The element id. + name: The endtype name. + face_number: The face number. 0 <= aFaceNumber < element face count. Note: Endtypes can only be set on faces that are placed at start or end points. @@ -153,17 +148,14 @@ def set_endtype_name_facet(element_id: int, name: str, face_number: int) -> None >>> endtype_name = "Dovetail_60x30" >>> face_number = 2 >>> etc.set_endtype_name_facet(element, endtype_name, face_number) - - Returns: - None """ -def set_endtype_id_start(element_id: int, endtype_id: int) -> None: - """Sets the endtype to start face by endtypeID +def set_endtype_id_start(element_id: ElementId, endtype_id: EndtypeId) -> None: + """Sets the endtype to start face by endtype id. Parameters: - element_id: element_id - endtype_id: endtype_id + element_id: The element id. + endtype_id: The endtype id. Examples: >>> import element_controller as ec @@ -173,17 +165,14 @@ def set_endtype_id_start(element_id: int, endtype_id: int) -> None: >>> element = selected_elements[0] >>> endtype_id = 12345 >>> etc.set_endtype_id_start(element, endtype_id) - - Returns: - None """ -def set_endtype_id_end(element_id: int, endtype_id: int) -> None: - """Sets the endtype to end face by endtypeID +def set_endtype_id_end(element_id: ElementId, endtype_id: EndtypeId) -> None: + """Sets the endtype to end face by endtype id. Parameters: - element_id: element_id - endtype_id: endtype_id + element_id: The element id. + endtype_id: The endtype id. Examples: >>> import element_controller as ec @@ -193,19 +182,16 @@ def set_endtype_id_end(element_id: int, endtype_id: int) -> None: >>> element = selected_elements[0] >>> endtype_id = 54321 >>> etc.set_endtype_id_end(element, endtype_id) - - Returns: - None """ -def set_endtype_id_facet(element_id: int, endtype_id: int, face_number: int) -> None: - """set endtype id facet +def set_endtype_id_facet(element_id: ElementId, endtype_id: EndtypeId, face_number: int) -> None: + """Sets the endtype to a face by endtype id. Parameters: - element_id: element_id - endtype_id: endtype_id - face_number: face_number + element_id: The element id. + endtype_id: The endtype id. + face_number: The face number. 0 <= aFaceNumber < element face count. Note: Endtypes can only be set on faces that are placed at start or end points. @@ -220,18 +206,15 @@ def set_endtype_id_facet(element_id: int, endtype_id: int, face_number: int) -> >>> endtype_id = 67890 >>> face_number = 3 >>> etc.set_endtype_id_facet(element, endtype_id, face_number) - - Returns: - None """ -def create_new_endtype(endtype_name: str, endtype_id: int, folder_name: str) -> int: - """Creates a new Endtype +def create_new_endtype(endtype_name: str, endtype_id: EndtypeId, folder_name: str) -> EndtypeId: + """Creates a new Endtype. Parameters: - endtype_name: endtype_name - endtype_id: endtype_id - folder_name: folder_name + endtype_name: The new endtype name. + endtype_id: The new endtype id. + folder_name: The new endtype folder. Examples: >>> import endtype_controller as etc @@ -243,14 +226,14 @@ def create_new_endtype(endtype_name: str, endtype_id: int, folder_name: str) -> >>> print(f"Created endtype with ID: {new_id}") Returns: - int + The ID of the created endtype. """ -def get_endtype_name(element_id: int) -> str: - """Gets the endtypename by endtypeID +def get_endtype_name(element_id: ElementId) -> str: + """Gets the endtype name by endtype id. Parameters: - element_id: element_id + element_id: The endtype id. Examples: >>> import endtype_controller as etc @@ -260,14 +243,14 @@ def get_endtype_name(element_id: int) -> str: >>> print(f"Endtype name: {endtype_name}") Returns: - str + The endtype name. """ -def get_endtype_name_start(element_id: int) -> str: - """Gets the endtypename of the start face +def get_endtype_name_start(element_id: ElementId) -> str: + """Gets the endtype name of the start face. Parameters: - element_id: element_id + element_id: The element id. Examples: >>> import element_controller as ec @@ -279,14 +262,14 @@ def get_endtype_name_start(element_id: int) -> str: >>> print(f"Start endtype name: {start_name}") Returns: - str + The endtype name of the start face. """ -def get_endtype_name_end(element_id: int) -> str: - """Gets the endtypename of the end face +def get_endtype_name_end(element_id: ElementId) -> str: + """Gets the endtype name of the end face. Parameters: - element_id: element_id + element_id: The element id. Examples: >>> import element_controller as ec @@ -298,15 +281,15 @@ def get_endtype_name_end(element_id: int) -> str: >>> print(f"End endtype name: {end_name}") Returns: - str + The endtype name of the end face. """ -def get_endtype_name_facet(element_id: int, face_number: int) -> str: - """get endtype name facet +def get_endtype_name_facet(element_id: ElementId, face_number: int) -> str: + """Gets the endtype name of the face with a number. Parameters: - element_id: element_id - face_number: face_number + element_id: The element id. + face_number: The face number. 0 <= aFaceNumber < element face count. Note: Endtypes can only be set on faces that are placed at start or end points. @@ -323,11 +306,11 @@ def get_endtype_name_facet(element_id: int, face_number: int) -> str: >>> print(f"Facet endtype name: {facet_name}") Returns: - str + The endtype name of the face. """ -def get_existing_tenon_ids() -> List[int]: - """Get the existing tenon endtypeIDs +def get_existing_tenon_ids() -> List[EndtypeId]: + """Get the existing tenon endtype id list. Examples: >>> import endtype_controller as etc @@ -336,11 +319,11 @@ def get_existing_tenon_ids() -> List[int]: >>> print(f"Available tenon endtype IDs: {tenon_ids}") Returns: - list of existing tenon endtypeIDs + List of existing tenon endtype id. """ -def get_existing_lengthening_ids() -> List[int]: - """Get the existing lengthening endtypeIDs +def get_existing_lengthening_ids() -> List[EndtypeId]: + """Get the existing lengthening endtype id list. Examples: >>> import endtype_controller as etc @@ -349,11 +332,11 @@ def get_existing_lengthening_ids() -> List[int]: >>> print(f"Available lengthening endtype IDs: {lengthening_ids}") Returns: - list of existing lengthening endtypeIDs + List of existing lengthening endtype id. """ -def get_existing_dovetail_ids() -> List[int]: - """Get the existing dovetail endtypeIDs +def get_existing_dovetail_ids() -> List[EndtypeId]: + """Get the existing dovetail endtype id list. Examples: >>> import endtype_controller as etc @@ -362,11 +345,11 @@ def get_existing_dovetail_ids() -> List[int]: >>> print(f"Available dovetail endtype IDs: {dovetail_ids}") Returns: - list of existing dovetail endtypeIDs + List of existing dovetail endtype id. """ -def get_existing_dovetail_dado_ids() -> List[int]: - """Get the existing dado endtypeIDs +def get_existing_dovetail_dado_ids() -> List[EndtypeId]: + """Get the existing dado endtype id list. Examples: >>> import endtype_controller as etc @@ -375,11 +358,11 @@ def get_existing_dovetail_dado_ids() -> List[int]: >>> print(f"Available dado endtype IDs: {dado_ids}") Returns: - list of existing dado endtypeIDs + List of existing dado endtype id. """ -def get_existing_japanese_tenon_ids() -> List[int]: - """Get the existing japanese-tenon endtypeIDs +def get_existing_japanese_tenon_ids() -> List[EndtypeId]: + """Get the existing japanese-tenon endtype id list. Examples: >>> import endtype_controller as etc @@ -388,11 +371,11 @@ def get_existing_japanese_tenon_ids() -> List[int]: >>> print(f"Available japanese-tenon endtype IDs: {japanese_tenon_ids}") Returns: - list of existing japanese-tenon endtypeIDs + List of existing japanese-tenon endtype id. """ def start_endtype_dialog() -> int: - """Start endtype dialog + """Start endtype dialog. Examples: >>> import endtype_controller as etc @@ -401,5 +384,5 @@ def start_endtype_dialog() -> int: >>> print(f"User selected endtype ID: {selected_endtype_id}") Returns: - Selected endtypeID + Selected endtype id. """ From 4de3d5101953af8a5c56e35e37fbe4463a805c00 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 11:24:19 +0200 Subject: [PATCH 16/30] [API-519] Improved the file controller documentation --- docs/documentation/bim_team_upload_result.md | 6 + docs/documentation/import_3dc_options.md | 6 + mkdocs.yml | 1 + src/file_controller/__init__.pyi | 448 +++++++++---------- 4 files changed, 224 insertions(+), 237 deletions(-) create mode 100644 docs/documentation/import_3dc_options.md diff --git a/docs/documentation/bim_team_upload_result.md b/docs/documentation/bim_team_upload_result.md index b15c2fd..dec1542 100644 --- a/docs/documentation/bim_team_upload_result.md +++ b/docs/documentation/bim_team_upload_result.md @@ -1,6 +1,12 @@ # BIMteam upload ::: cadwork.bim_team_upload_result + rendering: + show_root_heading: false + show_source: true + + +::: cadwork.bim_team_upload_result_code rendering: show_root_heading: false show_source: true \ No newline at end of file diff --git a/docs/documentation/import_3dc_options.md b/docs/documentation/import_3dc_options.md new file mode 100644 index 0000000..9fa2731 --- /dev/null +++ b/docs/documentation/import_3dc_options.md @@ -0,0 +1,6 @@ +# import_3dc_options + +::: cadwork.import_3dc_options + rendering: + show_root_heading: false + show_source: true \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index a41f720..db73c89 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,6 +56,7 @@ nav: - Camera: documentation/camera_data.md - Layer Settings: documentation/layer_settings.md - Text Object Options: documentation/text_object_options.md + - Import 3DC Options: documentation/import_3dc_options.md - Window Geometry: documentation/window_geometry.md - BIMteam Upload Result: documentation/bim_team_upload_result.md - Shoulder cut options: documentation/shoulder_options.md diff --git a/src/file_controller/__init__.pyi b/src/file_controller/__init__.pyi index 63ce1a2..97cd708 100644 --- a/src/file_controller/__init__.pyi +++ b/src/file_controller/__init__.pyi @@ -1,27 +1,29 @@ from typing import List -from cadwork import point_3d +from cadwork.import_3dc_options import import_3dc_options +from cadwork.point_3d import point_3d from cadwork.bim_team_upload_result import bim_team_upload_result from cadwork.dxf_layer_format_type import dxf_layer_format_type from cadwork.dxf_export_version import dxf_export_version +from cadwork.api_types import * def get_last_error(error_code: int) -> str: - """Gets the last error + """Gets the last error. Parameters: - error_code: error_code + error_code: The error code. Returns: - error string + The error string. """ -def export_stl_file(element_id_list: List[int], file_path: str) -> None: - """Exports an STL file +def export_stl_file(element_id_list: List[ElementId], file_path: str) -> None: + """Exports an STL file. Parameters: - element_id_list: element_id_list - file_path: file_path + element_id_list: The list of element id to export. + file_path: The output file path. Examples: >>> import element_controller as ec @@ -30,43 +32,40 @@ def export_stl_file(element_id_list: List[int], file_path: str) -> None: >>> selected_elements = ec.get_all_identifiable_element_ids() >>> output_path = r"C:/exports/model.stl" >>> fc.export_stl_file(selected_elements, output_path) - - Returns: - None """ -def import_step_file(file_path: str, scale_factor: float) -> List[int]: - """Imports a STEP file +def import_step_file(file_path: str, scale_factor: float) -> List[ElementId]: + """Imports a STEP file. Parameters: - file_path: file_path - scale_factor: scale_factor + file_path: The input file path. + scale_factor: The file scale factor. Returns: - imported element ID list + The imported list of element id. """ -def import_step_file_with_message_option(file_path: str, scale_factor: float, hide_message: bool) -> List[int]: - """Imports a STEP file +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. Parameters: - file_path: file_path - scale_factor: scale_factor - hide_message: hide_message + file_path: The input file path. + scale_factor: The file scale factor. + hide_message: Hide message. Returns: - imported element ID list + The imported list of element id. """ -def export_webgl(element_id_list: List[int], file_path: str) -> bool: - """Exports a WebGL file +def export_webgl(element_id_list: List[ElementId], file_path: str) -> bool: + """Exports a WebGL file. Parameters: - element_id_list: element_id_list - file_path: file_path + element_id_list: The list of element id to export. + file_path: The output file path. Examples: >>> import element_controller as ec @@ -79,16 +78,16 @@ def export_webgl(element_id_list: List[int], file_path: str) -> bool: >>> print("WebGL export completed successfully") Returns: - did operation succeed + True on successful export, false otherwise. """ -def export_3d_file(element_id_list: List[int], file_path: str) -> bool: - """Exports a 3D file +def export_3d_file(element_id_list: List[ElementId], file_path: str) -> bool: + """Exports a 3D file. Parameters: - element_id_list: element_id_list - file_path: file_path + element_id_list: The list of element id to export. + file_path: The output file path. Examples: >>> import element_controller as ec @@ -101,56 +100,58 @@ def export_3d_file(element_id_list: List[int], file_path: str) -> bool: >>> print("3D file export completed successfully") Returns: - did operation succeed + True on successful export, false otherwise. """ -def import_sat_file(file_path: str, scale_factor: float, binary: bool) -> List[int]: - """Imports an SAT file +def import_sat_file(file_path: str, scale_factor: float, binary: bool) -> List[ElementId]: + """Imports an SAT file. Parameters: - file_path: file_path - scale_factor: scale_factor - binary: binary + file_path: The input file path. + scale_factor: The scale factor. + binary: Is the import file binary. Returns: - imported element ID list + The imported list of element id. """ -def import_3dc_file(file_path: str) -> List[int]: - """Imports a 3DC file +def import_3dc_file(file_path: str) -> List[ElementId]: + """Imports a 3DC file. Parameters: - file_path: file_path + file_path: The input file path. Returns: - imported element ID list + The imported list of element id. """ -def import_rhino_file(file_path: str, without_dialog: bool) -> List[int]: - """Imports a Rhino file +def import_rhino_file(file_path: str, without_dialog: bool) -> List[ElementId]: + """Imports a Rhino file. Parameters: - file_path: file_path - without_dialog: without_dialog + file_path: The input file path. + without_dialog: Import without dialog? Returns: - imported element ID list + The imported list of element id. """ -def export_step_file(element_list: List[int], file_path: str, scale_factor: float, version: int, +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 + """Exports a STEP file. Parameters: - element_list: element_list - file_path: file_path - scale_factor: scale_factor - version: version - text_mode: text_mode + element_id_list: The list of element id to export. + file_path: The output file path. + scale_factor: The file scale factor. + version: The file export version : + - 214 = STEP AP214 + - 203 = STEP AP203 (default value) + text_mode: Use text mode. PARAMETER UNUSED Examples: >>> import element_controller as ec @@ -162,29 +163,23 @@ def export_step_file(element_list: List[int], file_path: str, scale_factor: floa >>> version = 214 # STEP version >>> text_mode = False >>> fc.export_step_file(selected_elements, output_path, scale_factor, version, text_mode) - - Returns: - None """ def import_3dz_file(file_path: str) -> None: - """Imports a 3DZ file + """Imports a 3DZ file. Parameters: - file_path: file_path - - Returns: - None + file_path: The input file path. """ -def export_obj_file(elements: List[int], file_path: str) -> None: - """Exports a OBJ file +def export_obj_file(element_id_list: List[ElementId], file_path: str) -> None: + """Exports a OBJ file. Parameters: - elements: elements - file_path: file_path + element_id_list: The list of element id to export. + file_path: The output file path. Examples: >>> import element_controller as ec @@ -193,40 +188,39 @@ def export_obj_file(elements: List[int], file_path: str) -> None: >>> selected_elements = ec.get_all_identifiable_element_ids() >>> output_path = r"C:/exports/model.obj" >>> fc.export_obj_file(selected_elements, output_path) - - Returns: - None """ -def import_sat_file_silently(file_path: str, scale_factor: float, binary: bool) -> List[int]: - """Imports a SAT File without messages +def import_sat_file_silently(file_path: str, scale_factor: float, binary: bool) -> List[ElementId]: + """Imports a SAT File without messages. Parameters: - file_path: file_path - scale_factor: scale_factor - binary: binary + file_path: The input file path. + scale_factor: The scale factor. + binary: Is the import file binary. Returns: - List[int] + The imported list of element id. """ -def export_fbx_file(elements: List[int], file_path: str, fbx_format: int) -> None: - """Exports a FBX file +def export_fbx_file(element_id_list: List[ElementId], file_path: str, fbx_format: int) -> None: + """Exports a FBX file. Parameters: - elements: elements - file_path: file_path - fbx_format: fbx_format - Available formats: - - 0 or default: FBX binary(*.fbx) - - 1: FBX binary(*.fbx) - - 2: FBX ascii(*.fbx) - - 3: FBX encrypted(*.fbx) - - 4: FBX 6.0 binary(*.fbx) - - 5: FBX 6.0 ascii(*.fbx) - - 6: FBX 6.0 encrypted(*.fbx) + element_id_list: The list of element id to export. + file_path: The output file path. + fbx_format: The FBX format. + + Available values : + + + - 1 = "FBX binary(*.fbx)"; + - 2 = "FBX ascii(*.fbx)"; + - 3 = "FBX encrypted(*.fbx)"; + - 4 = "FBX 6.0 binary(*.fbx)"; + - 5 = "FBX 6.0 ascii(*.fbx)"; + - 6 = "FBX 6.0 encrypted(*.fbx)"; Examples: >>> import element_controller as ec @@ -240,48 +234,39 @@ def export_fbx_file(elements: List[int], file_path: str, fbx_format: int) -> Non >>> # Export as ASCII format >>> fbx_format = 2 # FBX ascii format >>> fc.export_fbx_file(selected_elements, output_path, fbx_format) - - Returns: - None """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ -def import_3dc_file_with_glide(file_path: str) -> List[int]: - """Imports a 3DC file with glide +def import_3dc_file_with_glide(file_path: str) -> List[ElementId]: + """Imports a 3DC file with glide. Parameters: - file_path: file_path + file_path: The input file path. Returns: - imported element ID list + The imported list of element id. """ def import_btl_file(file_path: str) -> None: - """Imports a BTL file + """Imports a BTL file. Parameters: - file_path: file_path - - Returns: - None + file_path: The input file path. """ -def export_3dc_file(element_id_list: List[int], file_path: str) -> None: - """Exports a 3D file +def export_3dc_file(element_id_list: List[ElementId], file_path: str) -> None: + """Exports a 3D file. Parameters: - element_id_list: element_id_list - file_path: file_path + element_id_list: The list of element id to export. + file_path: The output file path. Examples: >>> import element_controller as ec @@ -290,50 +275,47 @@ def export_3dc_file(element_id_list: List[int], file_path: str) -> None: >>> selected_elements = ec.get_all_identifiable_element_ids() >>> output_path = r"C:/exports/model.3dc" >>> fc.export_3dc_file(selected_elements, output_path) - - Returns: - None """ def import_btl_file_for_nesting(file_path: str) -> None: - """Imports a BTL file for nesting + """Imports a BTL file for nesting. Parameters: - file_path: file_path - - Returns: - None + file_path: The input file path. """ def export_btl_file_for_nesting(file_path: str) -> None: - """Exports a BTL file for nesting + """Exports a BTL file for nesting. Parameters: - file_path: file_path + file_path: The output file path. Examples: >>> import file_controller as fc >>> output_path = r"C:/exports/nesting_project.btl" >>> fc.export_btl_file_for_nesting(output_path) - - Returns: - None """ -def export_rhino_file(element_id_list: List[int], file_path: str, version: int, use_default_assignment: bool, +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 + """Exports a 3dm rhino file. Parameters: - element_id_list: element_id_list - file_path: file_path - version: version - use_default_assignment: use_default_assignment - write_standard_attributes: write_standard_attributes + element_id_list: The list of element id to export. + file_path: The output file path. + version: The rhino version : + + + - 5 = V5.0, + - 6 = V6.0, + - 7 = V7.0, + - 8 = V8.0 + use_default_assignment: True if default assignment is used. False if no attributes are exported. + write_standard_attributes: True if exported with standard attribute, false otherwise. Examples: >>> import element_controller as ec @@ -345,52 +327,51 @@ def export_rhino_file(element_id_list: List[int], file_path: str, version: int, >>> use_default_assignment = True >>> write_standard_attributes = False >>> fc.export_rhino_file(selected_elements, output_path, version, use_default_assignment, write_standard_attributes) - - Returns: - None """ -def import_bxf_file(file_path: str, insert_position: point_3d) -> List[int]: - """import bxf file +def import_bxf_file(file_path: str, insert_position: point_3d) -> List[ElementId]: + """Imports a BXF file. Parameters: - file_path: file_path - insert_position: insert_position + file_path: The import file path. + insert_position: The position where the imported elements will be inserted. Returns: - List[int] + The list of IDs of the imported elements. """ def get_blum_export_path() -> str: - """get blum export path + """Gets the path of the Blum export. Returns: - str + The path of the Blum export. """ def set_blum_export_path(path: str) -> None: - """set blum export path + """Sets the path of the Blum export. Parameters: - path: path - - Returns: - None + path: The new path for the Blum export. """ -def export_sat_file(elements: List[int], file_path: str, scale_factor: float, binary: bool, version: int) -> None: - """exports a SAT File +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: - elements: elements - file_path: file_path - scale_factor: scale_factor - binary: binary - version: version + element_id_list: The list of element id to export. + file_path: The output file path. + scale_factor: The file scale factor. + binary: Whether to write the SAT file in binary or a human readable format. + version: The ACIS version to use : + + + - 3400 = v34.0 + - 3200 = v32.0 + - 2100 = v21.0 Examples: >>> import element_controller as ec @@ -402,18 +383,15 @@ def export_sat_file(elements: List[int], file_path: str, scale_factor: float, bi >>> binary_format = True >>> version = 25000 # SAT version >>> fc.export_sat_file(selected_elements, output_path, scale_factor, binary_format, version) - - Returns: - None """ -def export_glb_file(elements: List[int], file_path: str) -> None: - """exports a GLB File +def export_glb_file(element_id_list: List[ElementId], file_path: str) -> None: + """Exports a GLB File. Parameters: - elements: elements - file_path: file_path + element_id_list: The list of element id to export. + file_path: The output file path. Examples: >>> import element_controller as ec @@ -422,48 +400,51 @@ def export_glb_file(elements: List[int], file_path: str) -> None: >>> selected_elements = ec.get_all_identifiable_element_ids() >>> output_path = r"C:/exports/model.glb" >>> fc.export_glb_file(selected_elements, output_path) - - Returns: - None """ -def import_variant_file(file_path: str, insert_position: point_3d) -> List[int]: - """imports a variant by .val-File +def import_variant_file(file_path: str, insert_position: point_3d) -> List[ElementId]: + """Imports a variant (.val-File). Parameters: - file_path: file_path - insert_position: insert_position + file_path: The import file path. + insert_position: The position where the imported variant elements will be inserted. Returns: - imported element ID list + The imported list of element id. """ def import_element_light(file_path: str, insert_position: point_3d) -> int: - """import element light + """Imports a light element from a file. Parameters: - file_path: file_path - insert_position: insert_position + file_path: The import file path. + insert_position: The position where the imported light element will be inserted. Returns: - int + The ID of the imported light element. """ -def export_rhino_file_with_options(element_id_list: List[int], file_path: str, version: int, +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 + """Exports elements to a rhino 3dm file based on the export options. Parameters: - element_id_list: element_id_list - file_path: file_path - version: version - use_default_assignment: use_default_assignment - write_standard_attributes: write_standard_attributes - rhino_options: rhino_options + element_id_list: The list of element id to export. + file_path: The output file path. + version: The rhino version : + + + - 5 = V5.0, + - 6 = V6.0, + - 7 = V7.0, + - 8 = V8.0 + use_default_assignment: True if default assignment is used. False if no attributes are exported. + write_standard_attributes: True if exported with standard attribute, false otherwise. + rhino_options: The Rhino export option. Examples: >>> import element_controller as ec @@ -476,54 +457,50 @@ def export_rhino_file_with_options(element_id_list: List[int], file_path: str, v >>> write_standard_attributes = False >>> rhino_options = None # Use default options >>> fc.export_rhino_file_with_options(selected_elements, output_path, version, use_default_assignment, write_standard_attributes, rhino_options) - - Returns: - None """ -def import_3dc_file_with_options(file_path: str, import3dc_options: None) -> List[int]: - """imports a 3d or a 3dc file depending on the import 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. Parameters: - file_path: file_path - import3dc_options: import3dc_options + file_path: The input file path. + import_3dc_options: The 3dc import options. Returns: - imported element ID list + The imported list of element id. """ -def get_import_3dc_options() -> 'import_3dc_options': - """get import 3dc options +def get_import_3dc_options() -> import_3dc_options: + """Get the 3dc import options. Returns: - import_3dc_options + The 3dc import options. """ def load_webgl_preset_file(file_path: str) -> None: - """loads a preset file for the WebGl export + """Loads a preset file for the WebGl export. Parameters: - file_path: file_path - - Returns: - None + file_path: The preset file path. """ -def export_step_file_extrude_drillings(elements: List[int], file_path: str, scale_factor: float, version: int, +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 + """Exports a STEP file with extruded drillings. Parameters: - elements: elements - file_path: file_path - scale_factor: scale_factor - version: version - text_mode: text_mode - imperial_units: imperial_units + element_id_list: The list of element id to export. + file_path: The output file path. + scale_factor: The file scale factor. + version: The file export version : + - 214 = STEP AP214 + - 203 = STEP AP203 (default value) + text_mode: Use text mode. PARAMETER UNUSED + imperial_units: Use imperial units. Examples: >>> import element_controller as ec @@ -536,23 +513,22 @@ def export_step_file_extrude_drillings(elements: List[int], file_path: str, scal >>> text_mode = False >>> imperial_units = False >>> fc.export_step_file_extrude_drillings(selected_elements, output_path, scale_factor, version, text_mode, imperial_units) - - Returns: - None """ -def export_step_file_cut_drillings(elements: List[int], file_path: str, scale_factor: float, version: int, +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 + """Exports a STEP file with extruded drillings. Parameters: - elements: elements - file_path: file_path - scale_factor: scale_factor - version: version - text_mode: text_mode - imperial_units: imperial_units + element_id_list: The list of element id to export. + file_path: The output file path. + scale_factor: The file scale factor. + version: The file export version : + - 214 = STEP AP214 + - 203 = STEP AP203 (default value) + text_mode: Use text mode. PARAMETER UNUSED + imperial_units: Use imperial units. Examples: >>> import element_controller as ec @@ -565,60 +541,58 @@ def export_step_file_cut_drillings(elements: List[int], file_path: str, scale_fa >>> text_mode = False >>> imperial_units = False >>> fc.export_step_file_cut_drillings(selected_elements, output_path, scale_factor, version, text_mode, imperial_units) - - Returns: - None """ -def export_sat_file_cut_drillings(elements: List[int], file_path: str, +def export_sat_file_cut_drillings(element_id_list: List[ElementId], file_path: str, scale_factor: float, binary: bool, version: int) -> None: - """export sat file cut drillings + """Exports a SAT File with extruded drillings (cut drilling holes into bodies). Parameters: - elements: elements - file_path: file_path - scale_factor: scale_factor - binary: binary - version: version + element_id_list: The list of element id to export. + file_path: The output file path. + scale_factor: The file scale factor. + binary: Whether to write the SAT file in binary or a human readable format. + version: The ACIS version to use : - Returns: - None + + - 3400 = v34.0 + - 3200 = v32.0 + - 2100 = v21.0 """ -def upload_to_bim_team_and_create_share_link(elements: None - ) -> bim_team_upload_result: - """upload to bim team and create share link +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. Parameters: - elements: elements + element_id_list: The list of element id to export. Returns: - bim_team_upload_result + 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: - """export dxf file + """Exports visible elements in the scene to a DXF file. Parameters: - file_path: file_path - dxf_layer_format_type: dxf_layer_format_type - dxf_export_version: dxf_export_version + file_path: The output file path. + dxf_layer_format_type: The format type of how to organize layers. + dxf_export_version: The dxf version to use for the export. Returns: - bool + True on successful export, false otherwise. """ def export_dstv_file(file_path: str) -> bool: - """export dstv file + """Exports active elements in the scene to a DSTV (.stp) file. Parameters: - file_path: file_path + file_path: The output file path. Returns: - bool + True on successful export, false otherwise. """ From 52b401896452837da119ba3536d78acd517fbb01 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 11:47:10 +0200 Subject: [PATCH 17/30] [API-519] Improved the utility controller documentation --- src/utility_controller/__init__.pyi | 759 +++++++++++----------------- 1 file changed, 290 insertions(+), 469 deletions(-) diff --git a/src/utility_controller/__init__.pyi b/src/utility_controller/__init__.pyi index 9e5784a..9c98309 100644 --- a/src/utility_controller/__init__.pyi +++ b/src/utility_controller/__init__.pyi @@ -1,5 +1,6 @@ from typing import List from typing import Tuple +from cadwork.api_types import ElementId from cadwork.point_3d import point_3d from cadwork.window_geometry import window_geometry from cadwork.shortcut_key import shortcut_key @@ -7,346 +8,278 @@ from cadwork.shortcut_key_modifier import shortcut_key_modifier def get_last_error(error_code: int) -> str: - """Gets the last error + """Gets the last error. Parameters: - error_code: error_code + error_code: The error code. Returns: - error string + The error string. """ - def get_3d_version() -> int: - """Gets the 3D version + """Gets the 3D version. Returns: - 3D version + The 3D version. """ - def get_3d_build() -> int: - """Gets the 3D build + """Gets the 3D build. Returns: - 3D build + The 3D build. """ - def get_3d_file_path() -> str: - """Gets the 3D file path + """Gets the 3D file path. Returns: - 3D file path + The 3D file path. """ - -def set_project_data(element_id: str, data: str) -> None: - """Sets the project data +def set_project_data(project_data_id: str, data: str) -> None: + """Sets the project data. Parameters: - element_id: element_id - data: data - - Returns: - None + project_data_id: The project data id. + data: The data to set. """ def print_error(message: str) -> None: - """Prints an error + """Prints an error. Parameters: - message: message - - Returns: - None + message: The error message. """ def get_language() -> str: - """Gets the 3D language + """Gets the 3D language. Returns: - 3D language + The language. """ def print_message(message: str, row: int, column: int) -> None: - """Prints a message + """Prints a message. Parameters: - message: message - row: row - column: column - - Returns: - None + message: The message to print. + row: The row to print the message in. + column: The column to print the message in. """ def get_user_int(message: str) -> int: - """Prompts the user for an integer + """Prompts the user for an integer. Parameters: - message: message + message: The message to display. Returns: - user integer + The user input integer. """ def get_user_double(message: str) -> float: - """Prompts the user for a double + """Prompts the user for a double. Parameters: - message: message + message: The message to display. Returns: - user double + The user input double. """ def get_user_bool(message: str, default_yes: bool) -> bool: - """Prompts the user for a boolean + """Prompts the user for a boolean. Parameters: - message: message - default_yes: default_yes + message: The message to display. + default_yes: The default value, True by default. Returns: - user boolean + The user input boolean. """ def get_user_string(message: str) -> str: - """Prompts the user for a string + """Prompts the user for a string. Parameters: - message: message + message: The message to display. Returns: - user string + The user input string. """ def set_project_name(project_name: str) -> None: - """Sets the project name + """Sets the project name. Parameters: - project_name: project_name - - Returns: - None + project_name: The project name. """ def set_project_number(project_number: str) -> None: - """Sets the project number + """Sets the project number. Parameters: - project_number: project_number - - Returns: - None + project_number: The project number. """ def set_project_part(project_part: str) -> None: - """Sets the project part + """Sets the project part. Parameters: - project_part: project_part - - Returns: - None + project_part: The project part. """ def set_project_architect(project_architect: str) -> None: - """Sets the project architect + """Sets the project architect. Parameters: - project_architect: project_architect - - Returns: - None + project_architect: The project architect. """ def set_project_customer(project_customer: str) -> None: - """Sets the project customer + """Sets the project customer. Parameters: - project_customer: project_customer - - Returns: - None + project_customer: The project customer. """ def set_project_designer(project_designer: str) -> None: - """Sets the project designer + """Sets the project designer. Parameters: - project_designer: project_designer - - Returns: - None + project_designer: The project designer. """ def set_project_deadline(project_deadline: str) -> None: - """Sets the project deadline + """Sets the project deadline. Parameters: - project_deadline: project_deadline - - Returns: - None + project_deadline: The project deadline. """ def set_project_user_attribute(number: int, user_attribute: str) -> None: - """Sets the project user attribute + """Sets the project user attribute. Parameters: - number: number - user_attribute: user_attribute - - Returns: - None + number: The project user attribute number. + 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 + """Sets the project user attribute name. Parameters: - number: number - user_attribute_name: user_attribute_name - - Returns: - None + number: The project user attribute number. + user_attribute_name: The project user attribute name. """ def set_project_latitude(latitude: float) -> None: - """Sets the project latitude + """Sets the project latitude. Parameters: - latitude: latitude - - Returns: - None + latitude: The project latitude. """ def set_project_longitude(longitude: float) -> None: - """Sets the project longitude + """Sets the project longitude. Parameters: - longitude: longitude - - Returns: - None + longitude: The project longitude. """ def set_project_address(address: str) -> None: - """Sets the project address + """Sets the project address. Parameters: - address: address - - Returns: - None + address: The project address. """ def set_project_postal_code(postal_code: str) -> None: - """Sets the project postal code + """Sets the project postal code. Parameters: - postal_code: postal_code - - Returns: - None + postal_code: The project postal code. """ def set_project_city(city: str) -> None: - """Sets the project city + """Sets the project city. Parameters: - city: city - - Returns: - None + city: The project city. """ def set_project_country(country: str) -> None: - """Sets the project country + """Sets the project country. Parameters: - country: country - - Returns: - None + country: The project country. """ def get_user_file_from_dialog(name_filter: str) -> str: - """Gets a file with a dialog + """Gets a file with a dialog. Parameters: - name_filter: name_filter + name_filter: The dialog file filter. Returns: - file path + The file path. """ def get_client_number() -> str: - """Gets the client number + """Gets the client number. Returns: - client number + The client number. """ def get_user_point() -> point_3d: - """Gets a point from the user + """Gets a point from the user. Returns: - user point + The user point. """ def disable_auto_display_refresh() -> None: - """ - Disables the automatic refresh of the display. - - 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. - - Returns: - 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. """ def enable_auto_display_refresh() -> None: - """ - Enables the automatic refresh of the display. - 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. - + """Enables automatic display refresh. + 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. Examples: >>> import cadwork @@ -358,65 +291,56 @@ def enable_auto_display_refresh() -> None: >>> uc.enable_auto_display_refresh() >>> ec.recreate_elements(your_list_of_elements) - Note: If elements were created while display refresh was disabled, it's important to recreate these elements after enabling the display refresh to ensure they are properly visualized in cadwork. - - Returns: - None """ def create_new_guid() -> str: - """Creates a new GUID + """Creates a new GUID. Returns: - GUID + The new GUID. """ def print_to_console(message: str) -> None: - """Prints a message to the console + """Prints a message to the console. Parameters: - message: message - - Returns: - None + message: The message. """ def export_screen_to_image(file_path: str, factor: int) -> None: - """Exports the screen to an image + """Exports the screen to an image. Parameters: - file_path: file_path - factor: factor - - Returns: - None + file_path: The file path. + factor: The image factor. """ def get_new_user_file_from_dialog(name_filter: str) -> str: - """Gets a new file with a dialog + """Gets a new file with a dialog. Parameters: - name_filter: name_filter + name_filter: The dialog file filter. Returns: - file path + The file path. """ - + def api_autostart(api_name: str, option: int) -> int: - """Manages the autostart configuration for a specified API. + """Sets an API autostart option. Parameters: - api_name: Name of the API to be managed. - option: Determines the operation mode: + api_name: The name of the API be managed. + option: The autostart option to use. + - -1: Checks if API is configured for autostart without making changes. Returns 1 if API is found, 0 if not, or -1 in case of errors. - 1: Enables autostart for the specified API. @@ -427,7 +351,6 @@ def api_autostart(api_name: str, option: int) -> int: to manage the autostart state of the API. Examples: - >>> api_autostart("my_api", 1) # Enable autostart >>> api_autostart("my_api", 0) # Disable autostart >>> api_autostart("my_api", -1) # Check current autostart state @@ -438,846 +361,744 @@ def api_autostart(api_name: str, option: int) -> int: def enable_autostart(api_name: str) -> None: - """enable autostart + """Enables autostart for a given API. Parameters: - api_name: api_name - - Returns: - None + api_name: The name of the API for which to enable autostart. """ def disable_autostart(api_name: str) -> None: - """disable autostart + """Disables autostart for a given API. Parameters: - api_name: api_name - - Returns: - None + api_name: The name of the API for which to disable autostart. """ def check_autostart(api_name: str) -> bool: - """check autostart + """Checks if autostart is enabled for a given API. Parameters: - api_name: api_name + api_name: The name of the API to check. Returns: - bool + True if autostart is enabled, false otherwise. """ def delete_project_data(element_id: str) -> None: - """Deletes the project data + """Deletes the project data. Parameters: - element_id: element_id - - Returns: - None + element_id: The project data id. """ def run_external_program(name: str) -> bool: - """Runs a 3D external program + """Runs a 3D external program. Parameters: - name: name + name: The external program name. Returns: - external program return + False if the program could not be run, true otherwise. """ def save_3d_file_silently() -> None: - """Saves the 3D file silently - - Returns: - None + """Saves the 3D file silently. """ def get_licence_first_part() -> str: - """Gets the first part of the license + """Gets the first part of the licence. Returns: - first part of license + The first part of the licence. """ def get_licence_second_part() -> str: - """Gets the second part of the license + """Gets the second part of the licence. Returns: - second part of license + The second part of the licence. """ def show_progress_bar() -> None: - """Shows a ProgressBar in the CommandBar - - Returns: - None + """Shows a ProgressBar in the CommandBar. """ def update_progress_bar(value: int) -> None: - """Updates the ProgressBar with a value + """Updates the ProgressBar with a value. Parameters: - value: value - - Returns: - None + value: A value between 0 and 100. """ def hide_progress_bar() -> None: - """Hides the ProgressBar - - Returns: - None + """Hides the ProgressBar. """ def get_user_color(initial_color: int) -> int: - """Gets a color choosen by the user + """Gets a color choosen by the user. Parameters: - initial_color: initial_color + initial_color: The initial color. Returns: - the colornumber + The color number. """ def get_3d_linear_units() -> str: - """Gets the current linear units + """Gets the current linear units. Returns: - str + The current linear units. """ def get_3d_linear_display_units() -> str: - """Gets the current display units + """Gets the current display units. Returns: - str + The current display units. """ def get_3d_angular_units() -> str: - """Gets the current angular units + """Gets the current angular units. Returns: - str + The current angular units. """ def get_3d_angular_display_units() -> str: - """Gets the current angular display units + """Gets the current angular display units. Returns: - str + The current angular display units. """ def get_3d_build_date() -> str: - """Gets the current build date + """Gets the current build date. Returns: - str + The current build date. """ def set_project_elevation(elevation: float) -> None: - """Sets the project elevation + """Sets the project elevation. Parameters: - elevation: elevation - - Returns: - None + elevation: The project elevation. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ def push_check_and_query_data() -> None: - """push check and query data - - Returns: - None + """Pushes the current state of check and query data onto a stack. """ def pop_check_and_query_data() -> None: - """pop check and query data - - Returns: - None + """Pops the most recent state of check and query data from the stack. """ def change_check_and_query_data_to_no_queries() -> None: - """change check and query data to no queries - - Returns: - None + """Changes the current state of check and query data to no queries. """ def change_check_and_query_data_to_queries() -> None: - """change check and query data to queries - - Returns: - None + """Changes the current state of check and query data to allow queries. """ def is_direct_info_enabled() -> bool: - """is direct info enabled + """Checks if Direct Info is enabled. Returns: - bool + True if Direct Info is enabled, false otherwise. """ def enable_direct_info() -> None: - """enable direct info - - Returns: - None + """Enables Direct Info. """ def disable_direct_info() -> None: - """disable direct info - - Returns: - None + """Disables Direct Info. """ def load_attribute_display_settings(file_path: str) -> None: - """load attribute display settings + """Loads attribute display settings from a file. Parameters: - file_path: file_path - - Returns: - None + file_path: The path to the file containing the settings. """ def set_project_description(description: str) -> None: - """set project description + """Sets the project description. Parameters: - description: description - - Returns: - None + description: The new description for the project. """ def start_project_data_dialog() -> None: - """start project data dialog - - Returns: - None + """Starts the project data dialog. """ def init_LxSDK() -> None: - """init LxSDK - - Returns: - None + """Initializes the LxSDK. """ -def load_element_attribute_display_settings(file_path: str, elements: List[int]) -> None: - """load element attribute display settings +def load_element_attribute_display_settings(file_path: str, elements: List[ElementId]) -> None: + """Loads element attribute display settings from a file. Parameters: - file_path: file_path - elements: elements - - Returns: - None + file_path: The path to the file containing the settings. + elements: The element list for which to load the settings. """ def get_global_x_offset() -> float: - """get global x offset + """Gets the global X offset. Returns: - float + The global X offset. """ def set_global_x_offset(offset: float) -> None: - """set global x offset + """Sets the global X offset. Parameters: - offset: offset - - Returns: - None + offset: The new global X offset. """ def get_global_y_offset() -> float: - """get global y offset + """Gets the global Y offset. Returns: - float + The global Y offset. """ def set_global_y_offset(offset: float) -> None: - """set global y offset + """Sets the global Y offset. Parameters: - offset: offset - - Returns: - None + offset: The new global Y offset. """ def get_global_z_offset() -> float: - """get global z offset + """Gets the global Z offset. Returns: - float + The global Z offset. """ def set_global_z_offset(offset: float) -> None: - """set global z offset + """Sets the global Z offset. Parameters: - offset: offset - - Returns: - None + offset: The new global Z offset. """ def show_north_arrow() -> None: - """show north arrow - - Returns: - None + """Shows the north arrow on the 3D view. """ def hide_north_arrow() -> None: - """hide north arrow - - Returns: - None + """Hides the north arrow on the 3D view. """ def is_north_arrow_visible() -> bool: - """is north arrow visible + """Checks if the north arrow is visible on the 3D view. Returns: - bool + True if the north arrow is visible, false otherwise. """ def get_north_angle() -> float: - """get north angle + """Gets the angle of the north direction. Returns: - float + The angle of the north direction in degrees. """ def set_north_angle(north_angle: float) -> None: - """set north angle + """Sets the angle of the north direction. Parameters: - north_angle: north_angle - - Returns: - 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: - """get user file from dialog in path + """Gets a user file from a dialog in a specified path. Parameters: - name_filter: name_filter - path: path + name_filter: The filter for the dialog. + path: The path in which to get the user file. Returns: - str + A string containing the user file. """ def get_new_user_file_from_dialog_in_path(name_filter: str, path: str) -> str: - """get new user file from dialog in path + """Gets a new user file from a dialog in a specified path. Parameters: - name_filter: name_filter - path: path + name_filter: The filter for the dialog. + path: The path in which to get the new user file. Returns: - str + A string containing the new user file. """ def enable_update_variant() -> None: - """enable update variant - - Returns: - None + """Enables the update variant. """ def disable_update_variant() -> None: - """disable update variant - - Returns: - None + """Disables the update variant. """ def get_user_points() -> List[point_3d]: - """get user points + """Gets user points. Returns: - List[point_3d] + A list of user points. """ def get_user_points_with_count(count: int) -> List[point_3d]: - """get user points with count + """Gets user points with a specified count. Parameters: - count: count + count: The number of user points to get. Returns: - List[point_3d] + A list of user points. """ def get_user_path_from_dialog() -> str: - """get user path from dialog + """Gets the user path from a dialog. Returns: - str + A string containing the user path. """ def get_user_path_from_dialog_in_path(path: str) -> str: - """get user path from dialog in path + """Gets the user path from a dialog in a specified path. Parameters: - path: path + path: The path in which to get the user path. Returns: - str + A string containing the user path. """ def execute_shortcut(shortcut_key_modifier: shortcut_key_modifier, shortcut_key: shortcut_key) -> None: - """execute shortcut + """Executes a shortcut. Parameters: - shortcut_key_modifier: shortcut_key_modifier - shortcut_key: shortcut_key - - Returns: - None + shortcut_key_modifier: The modifier key for the shortcut. + 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 file path + """Runs a 3D external program from a custom directory. Parameters: - file_path: file_path + file_path: The external program file path. Returns: - external program return + False if error, true otherwise. """ def get_3d_file_name() -> str: - """Gets the 3D file name + """Gets the 3D file name. Returns: - 3D file name + The 3D file name. """ def get_project_data(element_id: str) -> str: - """Gets the project data + """Gets the project data. Parameters: - element_id: element_id + element_id: The project data id. Returns: - project data + The project data. """ def get_project_name() -> str: - """Gets the project name + """Gets the project name. Returns: - project name + The project name. """ def get_project_part() -> str: - """Sets the project part + """Gets the project part. Returns: - project part + The project part. """ def get_project_architect() -> str: - """Gets the project architect + """Gets the project architect. Returns: - project architect + The project architect. """ def get_project_number() -> str: - """Gets the project number + """Gets the project number. Returns: - project number + The project number. """ def get_project_customer() -> str: - """Gets the project customer + """Gets the project customer. Returns: - project customer + The project customer. """ def get_project_designer() -> str: - """Gets the project designer + """Gets the project designer. Returns: - project designer + The project designer. """ def get_project_deadline() -> str: - """Gets the project deadline + """Gets the project deadline. Returns: - project deadline + The project deadline. """ def get_project_user_attribute(number: int) -> str: - """Gets the project user attribute + """Gets the project user attribute. Parameters: - number: number + number: The project user attribute number. Returns: - project user attribute + The project user attribute. """ def get_project_user_attribute_name(number: int) -> str: - """Gets the project user attribute name + """Gets the project user attribute name. Parameters: - number: number + number: The project user attribute number. Returns: - project user attribute name + The project user attribute name. """ def get_project_latitude() -> float: - """Gets the project latitude + """Gets the project latitude. Returns: - project latitude + The project latitude. """ def get_project_longitude() -> float: - """Gets the project longitude + """Gets the project longitude. Returns: - project longitude + The project longitude. """ def get_project_postal_code() -> str: - """Gets the project postal code + """Gets the project postal code. Returns: - project postal code + The project postal code. """ def get_project_address() -> str: - """Gets the project address + """Gets the project address. Returns: - project address + The project address. """ def get_project_city() -> str: - """Gets the project city + """Gets the project city. Returns: - project city + The project city. """ def get_project_country() -> str: - """Gets the project country + """Gets the project country. Returns: - project country + The project country. """ def get_project_elevation() -> float: - """Gets the project elevation + """Gets the project elevation. Returns: - project elevation + The project elevation. """ def get_project_description() -> str: - """get project description + """Gets the project description. Returns: - str + A string containing the project description. """ def get_project_guid() -> str: - """Gets the project GUID + """Gets the project GUID. Returns: - project GUID + The project GUID. """ def get_3d_userprofil_path() -> str: - """Gets the 3D userprofil path + """Gets the 3D userprofil path. Returns: - the 3D userprofil path + The 3D userprofil path. """ def get_plugin_path() -> str: - """get plugin path + """Gets the plugin path. Returns: - str + A string containing the plugin path. """ def get_millimetre_from_imperial_string(value: str) -> float: - """get millimetre from imperial string + """Converts an imperial string to millimetres. Parameters: - value: value + value: The imperial string to convert. Returns: - float + The value in millimetres. """ def get_imperial_string_from_millimetre(value: float) -> str: - """get imperial string from millimetre + """Converts a value in millimetres to an imperial string. Parameters: - value: value + value: The value in millimetres to convert. Returns: - str + The value as an imperial string. """ def get_user_catalog_path() -> str: - """get user catalog path + """Gets the user catalog path. Returns: - str + A string containing the user catalog path. """ def get_3d_hwnd() -> int: - """Gets the 3D HWND + """Gets the 3D HWND. Returns: - 3D HWND + The 3D HWND. """ def close_cadwork_document_saved() -> None: - """close cadwork saved - - Returns: - None + """close cadwork saved. """ def close_cadwork_document_unsaved() -> None: - """close cadwork document unsaved - - Returns: - None + """close cadwork unsaved. """ def get_use_of_global_coordinates() -> bool: - """get use of global coordinates + """Gets the use of global coordinates. Returns: - 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 + """Sets the use of global coordinates. Parameters: - use_of_global_coordinates: use_of_global_coordinates - - Returns: - None + use_of_global_coordinates: True to use global coordinates, false otherwise. """ def get_global_origin() -> point_3d: - """Gets the global origin + """Gets the global origin. Returns: - global origin + The global origin. """ def set_global_origin(global_origin: point_3d) -> None: - """Sets the global origin + """Sets the global origin. Parameters: - global_origin: global_origin - - Returns: - None + global_origin: The global origin. """ def create_snapshot() -> str: - """get snapshot from screen + """Get snapshot from screen. Returns: - snapshot + The snapshot as a string. """ def get_3d_gui_upper_left_screen_coordinates() -> Tuple[int, int]: - """get 3d gui upper left screen coordinates + """Get the coordinates of the upper left corner of the 3D GUI. Returns: - coordinates of the upper left corner of the 3D GUI + The coordinates of the upper left corner of the 3D GUI. """ def get_3d_main_window_geometry() -> 'window_geometry': - """get 3d main window geometry + """Get the geometry of 3d main window. Returns: - window geometry + The geometry of the 3D main window. """ def get_project_data_keys() -> List[str]: - """get project data keys + """Gets all keys for project data. Returns: - List[str] + The list of project data keys. """ def get_user_int_with_default_value(message: str, default_value: int) -> int: - """get user int with default value + """Prompts the user for an integer with a default value. Parameters: - message: message - default_value: default_value + message: The message to display. + default_value: The default value. Returns: - int + The user integer. """ def get_user_double_with_default_value(message: str, default_value: float) -> float: - """get user double with default value + """Prompts the user for a double with a default value. Parameters: - message: message - default_value: default_value + message: The message to display. + default_value: The default value. Returns: - float + The user double. """ def get_user_string_with_default_value(message: str, default_value: str) -> str: - """get user string with default value + """Prompts the user for a string with a default value. Parameters: - message: message - default_value: default_value + message: The message to display. + default_value: The default value. Returns: - str + The user string. """ def get_3d_version_name() -> str: - """get 3d version name + """Gets the 3D version name. Returns: - str + The 3D version name. """ def redirect_python_output_to_logger() -> None: - """redirect python output to logger. - This function is used to redirect the output of the Python interpreter to the logger. - This is useful for debugging and logging purposes. - - Returns: - 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. """ From 35591eefdf868ea5596367ad640e86430102b8e2 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 11:49:19 +0200 Subject: [PATCH 18/30] [API-519] Removed get_last_error method --- src/endtype_controller/__init__.pyi | 10 ---------- src/file_controller/__init__.pyi | 12 ------------ src/geometry_controller/__init__.pyi | 11 ----------- src/list_controller/__init__.pyi | 11 ----------- src/machine_controller/__init__.pyi | 10 ---------- src/material_controller/__init__.pyi | 10 ---------- src/roof_controller/__init__.pyi | 10 ---------- src/scene_controller/__init__.pyi | 10 ---------- src/shop_drawing_controller/__init__.pyi | 9 --------- src/utility_controller/__init__.pyi | 10 ---------- src/visualization_controller/__init__.pyi | 10 ---------- 11 files changed, 113 deletions(-) diff --git a/src/endtype_controller/__init__.pyi b/src/endtype_controller/__init__.pyi index bc7b5e5..1fccb18 100644 --- a/src/endtype_controller/__init__.pyi +++ b/src/endtype_controller/__init__.pyi @@ -1,16 +1,6 @@ from typing import List from cadwork.api_types import * -def get_last_error(error_code: int) -> str: - """Gets the last error message. - - Parameters: - error_code: A pointer to an integer where the error code will be stored. - - Returns: - A string containing the last error message. - """ - def get_endtype_id(name: str) -> EndtypeId: """Gets the endtype id by endtype name. diff --git a/src/file_controller/__init__.pyi b/src/file_controller/__init__.pyi index 97cd708..2cb38d0 100644 --- a/src/file_controller/__init__.pyi +++ b/src/file_controller/__init__.pyi @@ -6,18 +6,6 @@ from cadwork.dxf_layer_format_type import dxf_layer_format_type from cadwork.dxf_export_version import dxf_export_version from cadwork.api_types import * - -def get_last_error(error_code: int) -> str: - """Gets the last error. - - Parameters: - error_code: The error code. - - Returns: - The error string. - """ - - def export_stl_file(element_id_list: List[ElementId], file_path: str) -> None: """Exports an STL file. diff --git a/src/geometry_controller/__init__.pyi b/src/geometry_controller/__init__.pyi index de9fdbb..4ab7241 100644 --- a/src/geometry_controller/__init__.pyi +++ b/src/geometry_controller/__init__.pyi @@ -1111,14 +1111,3 @@ def get_standard_element_length_from_name(standard_element_name: str) -> float: Returns: float """ - - -def get_last_error(error_code: int) -> str: - """get last error - - Parameters: - error_code: error_code - - Returns: - str - """ diff --git a/src/list_controller/__init__.pyi b/src/list_controller/__init__.pyi index 710163d..8e1f5a9 100644 --- a/src/list_controller/__init__.pyi +++ b/src/list_controller/__init__.pyi @@ -1,17 +1,6 @@ from typing import List -def get_last_error(error_code: int) -> str: - """Gets the last error - - Parameters: - error_code: error_code - - Returns: - error string - """ - - def export_production_list(element_id_list: List[int], file_path: str) -> None: """Exports a production list diff --git a/src/machine_controller/__init__.pyi b/src/machine_controller/__init__.pyi index ce864ef..799d7c3 100644 --- a/src/machine_controller/__init__.pyi +++ b/src/machine_controller/__init__.pyi @@ -2,16 +2,6 @@ from typing import List from cadwork import vertex_list -def get_last_error(error_code: int) -> str: - """Gets the last error - - Parameters: - error_code: error_code - - Returns: - error string - """ - def export_btl(btl_version: int, file_path: str) -> None: """Exports a BTL file diff --git a/src/material_controller/__init__.pyi b/src/material_controller/__init__.pyi index 9044e5c..275d7da 100644 --- a/src/material_controller/__init__.pyi +++ b/src/material_controller/__init__.pyi @@ -1,15 +1,5 @@ from typing import List -def get_last_error(error_code: int) -> str: - """Gets the last error - - Parameters: - error_code: error_code - - Returns: - error string - """ - def create_material(name: str) -> int: """Creates new material diff --git a/src/roof_controller/__init__.pyi b/src/roof_controller/__init__.pyi index 4424bf2..b39daa0 100644 --- a/src/roof_controller/__init__.pyi +++ b/src/roof_controller/__init__.pyi @@ -28,16 +28,6 @@ def get_all_caddy_element_ids() -> List[int]: element ID list """ -def get_last_error(a0: int) -> str: - """get last error - - Parameters: - a0: a0 - - Returns: - str - """ - def clear_errors() -> None: """clear errors diff --git a/src/scene_controller/__init__.pyi b/src/scene_controller/__init__.pyi index a9ce1d3..2e3f75f 100644 --- a/src/scene_controller/__init__.pyi +++ b/src/scene_controller/__init__.pyi @@ -1,15 +1,5 @@ from typing import List -def get_last_error(error_code: int) -> str: - """Gets the last error - - Parameters: - error_code: error_code - - Returns: - error string - """ - def add_scene(name: str) -> bool: """Adds a new scene diff --git a/src/shop_drawing_controller/__init__.pyi b/src/shop_drawing_controller/__init__.pyi index 2e2015f..54b253e 100644 --- a/src/shop_drawing_controller/__init__.pyi +++ b/src/shop_drawing_controller/__init__.pyi @@ -1,15 +1,6 @@ from typing import List from cadwork.point_3d import point_3d -def get_last_error(error_code: int) -> str: - """Gets the last error - - Parameters: - error_code: error_code - - Returns: - error string - """ def export_2d_wireframe_with_clipboard(clipboard_number: int, with_layout: bool) -> None: """Exports a 2D wireframe to the clipboard diff --git a/src/utility_controller/__init__.pyi b/src/utility_controller/__init__.pyi index 9c98309..a4edd95 100644 --- a/src/utility_controller/__init__.pyi +++ b/src/utility_controller/__init__.pyi @@ -7,16 +7,6 @@ from cadwork.shortcut_key import shortcut_key from cadwork.shortcut_key_modifier import shortcut_key_modifier -def get_last_error(error_code: int) -> str: - """Gets the last error. - - Parameters: - error_code: The error code. - - Returns: - The error string. - """ - def get_3d_version() -> int: """Gets the 3D version. diff --git a/src/visualization_controller/__init__.pyi b/src/visualization_controller/__init__.pyi index 1fc703c..ad1c9b6 100644 --- a/src/visualization_controller/__init__.pyi +++ b/src/visualization_controller/__init__.pyi @@ -2,16 +2,6 @@ from typing import List from cadwork.camera_data import camera_data from cadwork.point_3d import point_3d -def get_last_error(error_code: int) -> str: - """Gets the last error - - Parameters: - error_code: error_code - - Returns: - error string - """ - def set_color(element_id_list: List[int], color_id: int) -> None: """Sets the element color From 947060f9ed0da5e345173d7fcba6e005955ad233 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 14:28:40 +0200 Subject: [PATCH 19/30] [API-519] Improved the geometry controller documentation --- src/geometry_controller/__init__.pyi | 957 +++++++++++---------------- 1 file changed, 379 insertions(+), 578 deletions(-) diff --git a/src/geometry_controller/__init__.pyi b/src/geometry_controller/__init__.pyi index 4ab7241..35323b9 100644 --- a/src/geometry_controller/__init__.pyi +++ b/src/geometry_controller/__init__.pyi @@ -1,1113 +1,914 @@ from typing import List +from cadwork.api_types import ElementId, UnsignedInt from cadwork.facet_list import facet_list from cadwork.point_3d import point_3d -def rotate_height_axis_90(element_id_list: List[int]) -> None: - """rotate height axis 90 +def rotate_height_axis_90(element_id_list: List[ElementId]) -> None: + """Rotates the element height axis 90 degrees. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ - -def rotate_height_axis_180(element_id_list: List[int]) -> None: - """rotate height axis 180 +def rotate_height_axis_180(element_id_list: List[ElementId]) -> None: + """Rotates the element height axis 180 degrees. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ - -def set_over_width(element_id_list: List[int], value: float) -> None: - """set over width +def set_over_width(element_id_list: List[ElementId], value: float) -> None: + """Sets the element overwidth. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element overwidth. """ - -def set_over_height(element_id_list: List[int], value: float) -> None: - """set over height +def set_over_height(element_id_list: List[ElementId], value: float) -> None: + """Sets the element overheight. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element overheight. """ - -def set_over_length(element_id_list: List[int], value: float) -> None: - """set over length +def set_over_length(element_id_list: List[ElementId], value: float) -> None: + """Sets the element overlength. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element overlength. """ - -def set_rounding_width(element_id_list: List[int], value: float) -> None: - """set rounding width +def set_rounding_width(element_id_list: List[ElementId], value: float) -> None: + """Sets the element rounding width. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element rounding width. """ - -def set_rounding_height(element_id_list: List[int], value: float) -> None: - """set rounding height +def set_rounding_height(element_id_list: List[ElementId], value: float) -> None: + """Sets the element rounding height. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element rounding height. """ - -def set_rounding_length(element_id_list: List[int], value: float) -> None: - """set rounding length +def set_rounding_length(element_id_list: List[ElementId], value: float) -> None: + """Sets the element rounding length. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element rounding length. """ - -def set_cross_correction_negative_width(element_id_list: List[int], value: float) -> None: - """set cross correction negative width +def set_cross_correction_negative_width(element_id_list: List[ElementId], value: float) -> None: + """Sets the element negative width cross correction. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element negative width cross correction. """ - -def set_cross_correction_positive_width(element_id_list: List[int], value: float) -> None: - """set cross correction positive width +def set_cross_correction_positive_width(element_id_list: List[ElementId], value: float) -> None: + """Sets the element positive width cross correction. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element positive width cross correction. """ - -def set_cross_correction_negative_height(element_id_list: List[int], value: float) -> None: - """set cross correction negative height +def set_cross_correction_negative_height(element_id_list: List[ElementId], value: float) -> None: + """Sets the element negative height cross correction. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element negative height cross correction. """ - -def set_cross_correction_positive_height(element_id_list: List[int], value: float) -> None: - """set cross correction positive height +def set_cross_correction_positive_height(element_id_list: List[ElementId], value: float) -> None: + """Sets the element positive height cross correction. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element positive height cross correction. """ - -def set_cross_correction_negative_length(element_id_list: List[int], value: float) -> None: - """set cross correction negative length +def set_cross_correction_negative_length(element_id_list: List[ElementId], value: float) -> None: + """Sets the element negative length cross correction. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element negative length cross correction. """ - -def set_cross_correction_positive_length(element_id_list: List[int], value: float) -> None: - """set cross correction positive length +def set_cross_correction_positive_length(element_id_list: List[ElementId], value: float) -> None: + """Sets the element positive length cross correction. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: The element positive length cross correction. """ - -def apply_global_scale(element_id_list: List[int], scale: float, origin: point_3d) -> None: - """apply global scale +def apply_global_scale(element_id_list: List[ElementId], scale: float, origin: point_3d) -> None: + """Applies a global scale to element. Parameters: - element_id_list: element_id_list - scale: scale - origin: origin - - Returns: - None + element_id_list: The element id list. + scale: The global scale. + origin: The scaling origin. """ - -def auto_regenerate_axes(element_id_list: List[int]) -> None: - """auto regenerate axes +def auto_regenerate_axes(element_id_list: List[ElementId]) -> None: + """Automatically regenerates axes on element. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ - -def rotate_length_axis_90(element_id_list: List[int]) -> None: - """rotate length axis 90 +def rotate_length_axis_90(element_id_list: List[ElementId]) -> None: + """Rotates element length axis 90 degrees. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ - -def rotate_length_axis_180(element_id_list: List[int]) -> None: - """rotate length axis 180 +def rotate_length_axis_180(element_id_list: List[ElementId]) -> None: + """Rotates element length axis 180 degrees. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ - -def invert_model(element_id_list: List[int]) -> None: - """invert model +def invert_model(element_id_list: List[ElementId]) -> None: + """Inverts element model. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The element id list. """ - -def set_width_real(elements: List[int], width: float) -> None: - """set width real +def set_width_real(element_id_list: List[ElementId], width: float) -> None: + """Sets the element real width. Parameters: - elements: elements - width: width - - Returns: - None + element_id_list: The element id list. + width: The element real width. """ - -def set_height_real(elements: List[int], height: float) -> None: - """set height real +def set_height_real(element_id_list: List[ElementId], height: float) -> None: + """Sets the element real height. Parameters: - elements: elements - height: height - - Returns: - None + element_id_list: The element id list. + height: The element real height. """ - -def set_length_real(elements: List[int], length: float) -> None: - """set length real +def set_length_real(element_id_list: List[ElementId], length: float) -> None: + """Sets the element real length. Parameters: - elements: elements - length: length - - Returns: - None + element_id_list: The element id list. + length: The element real length. """ - -def rotate_height_axis_2_points(elements: List[int], point1: point_3d, point2: point_3d) -> None: - """rotate height axis 2 points +def rotate_height_axis_2_points(element_id_list: List[ElementId], point1: point_3d, point2: point_3d) -> None: + """Rotates the element height axis via 2 points. Parameters: - elements: elements - point1: point1 - point2: point2 - - Returns: - None + element_id_list: The element id list. + point1: The first point. + point2: The second point. """ - def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ - -def set_drilling_tolerance(elements: List[int], tolerance: float) -> None: - """set drilling tolerance +def set_drilling_tolerance(element_id_list: List[ElementId], tolerance: float) -> None: + """Sets the drilling tolerance of the axis. Parameters: - elements: elements - tolerance: tolerance - - Returns: - None + element_id_list: The element id list. + tolerance: The new drilling tolerance. """ - -def auto_regenerate_axes_silently(element_id_list: List[int]) -> None: - """auto regenerate axes silently +def auto_regenerate_axes_silently(element_id_list: List[ElementId]) -> None: + """Automatically regenerates axes on elements without any user interaction. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element IDs for which the axes will be regenerated. """ - -def rotate_length_axis_2_points(elements: List[int], point1: point_3d, point2: point_3d) -> None: - """rotate length axis 2 points +def rotate_length_axis_2_points(element_id_list: List[ElementId], point1: point_3d, point2: point_3d) -> None: + """Rotates the element length axis via 2 points. Parameters: - elements: elements - point1: point1 - point2: point2 - - Returns: - None + element_id_list: The element id list. + point1: The first point. + point2: The second point. """ - -def get_width(element_id: int) -> float: - """get width +def get_width(element_id: ElementId) -> float: + """Gets the element width. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element width. """ - -def get_height(element_id: int) -> float: - """get height +def get_height(element_id: ElementId) -> float: + """Gets the element height. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element height. """ - -def get_length(element_id: int) -> float: - """get length +def get_length(element_id: ElementId) -> float: + """Gets the element length. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element length. """ - -def get_p1(element_id: int) -> point_3d: - """get p1 +def get_p1(element_id: ElementId) -> point_3d: + """Gets the element P1. Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element P1. """ - -def get_p2(element_id: int) -> point_3d: - """get p2 +def get_p2(element_id: ElementId) -> point_3d: + """Gets the element P2. Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element P2. """ - -def get_p3(element_id: int) -> point_3d: - """get p3 +def get_p3(element_id: ElementId) -> point_3d: + """Gets the element P3. Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element P3. """ - -def get_start_height_cut_angle(element_id: int) -> float: - """get start height cut angle +def get_start_height_cut_angle(element_id: ElementId) -> float: + """Gets the element start height cut angle. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element start height cut angle. """ - -def get_start_width_cut_angle(element_id: int) -> float: - """get start width cut angle +def get_start_width_cut_angle(element_id: ElementId) -> float: + """Gets the element start width cut angle. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element start width cut angle. """ - -def get_end_height_cut_angle(element_id: int) -> float: - """get end height cut angle +def get_end_height_cut_angle(element_id: ElementId) -> float: + """Gets the element end height cut angle. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element end height cut angle. """ - -def get_end_width_cut_angle(element_id: int) -> float: - """get end width cut angle +def get_end_width_cut_angle(element_id: ElementId) -> float: + """Gets the element end width cut angle. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element end width cut angle. """ - -def get_over_width(element_id: int) -> float: - """get over width +def get_over_width(element_id: ElementId) -> float: + """Gets the element overwidth. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element overwidth. """ - -def get_over_height(element_id: int) -> float: - """get over height +def get_over_height(element_id: ElementId) -> float: + """Gets the element overheight. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element overheight. """ - -def get_over_length(element_id: int) -> float: - """get over length +def get_over_length(element_id: ElementId) -> float: + """Gets the element overlength. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element overlength. """ - -def get_rounding_width(element_id: int) -> float: - """get rounding width +def get_rounding_width(element_id: ElementId) -> float: + """Gets the element rounding width. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element rounding width. """ - -def get_rounding_height(element_id: int) -> float: - """get rounding height +def get_rounding_height(element_id: ElementId) -> float: + """Gets the element rounding height. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element rounding height. """ - -def get_rounding_length(element_id: int) -> float: - """get rounding length +def get_rounding_length(element_id: ElementId) -> float: + """Gets the element rounding length. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element rounding length. """ - -def get_cross_correction_negative_width(element_id: int) -> float: - """get cross correction negative width +def get_cross_correction_negative_width(element_id: ElementId) -> float: + """Gets the element negative width cross correction. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element negative width cross correction. """ - -def get_cross_correction_positive_width(element_id: int) -> float: - """get cross correction positive width +def get_cross_correction_positive_width(element_id: ElementId) -> float: + """Gets the element positive width cross correction. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element positive width cross correction. """ - -def get_cross_correction_negative_height(element_id: int) -> float: - """get cross correction negative height +def get_cross_correction_negative_height(element_id: ElementId) -> float: + """Gets the element negative height cross correction. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element negative height cross correction. """ - -def get_cross_correction_positive_height(element_id: int) -> float: - """get cross correction positive height +def get_cross_correction_positive_height(element_id: ElementId) -> float: + """Gets the element positive height cross correction. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element positive height cross correction. """ - -def get_cross_correction_negative_length(element_id: int) -> float: - """get cross correction negative length +def get_cross_correction_negative_length(element_id: ElementId) -> float: + """Gets the element negative length cross correction. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element negative length cross correction. """ - -def get_cross_correction_positive_length(element_id: int) -> float: - """get cross correction positive length +def get_cross_correction_positive_length(element_id: ElementId) -> float: + """Gets the element positive length cross correction. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element positive length cross correction. """ - -def get_weight(element_id: int) -> float: - """get weight +def get_weight(element_id: ElementId) -> float: + """Gets the element real weight. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element real weight. """ - -def get_list_weight(element_id: int) -> float: - """get list weight +def get_list_weight(element_id: ElementId) -> float: + """Gets the element list weight. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element list weight. """ - -def get_volume(element_id: int) -> float: - """get volume +def get_volume(element_id: ElementId) -> float: + """Gets the element rough volume (does not include negative geometry operations, such as end-types, drillings, connectors, openings, and MEP elements). Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element rough volume. """ - -def get_list_volume(element_id: int) -> float: - """get list volume +def get_list_volume(element_id: ElementId) -> float: + """Gets the element list volume. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element list volume. """ - -def get_xl(element_id: int) -> point_3d: - """get xl +def get_xl(element_id: ElementId) -> point_3d: + """Gets the element length axis direction (direction from P1 to P2). Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element XL vector. """ - -def get_yl(element_id: int) -> point_3d: - """get yl +def get_yl(element_id: ElementId) -> point_3d: + """Gets the element width axis direction (ZL cross XL). Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element YL vector. """ - -def get_zl(element_id: int) -> point_3d: - """get zl +def get_zl(element_id: ElementId) -> point_3d: + """Gets the element height/thickness axis direction (direction from P1 to P3). Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element ZL vector. """ - -def get_center_of_gravity(element_id: int) -> point_3d: - """get center of gravity +def get_center_of_gravity(element_id: ElementId) -> point_3d: + """Gets the element center of gravity. Parameters: - element_id: element_id + element_id: The element Id. Returns: - point_3d + The element center of gravity position. """ - -def get_reference_side(element_id: int) -> int: - """get reference side +def get_reference_side(element_id: ElementId) -> int: + """Gets the element reference side. Parameters: - element_id: element_id + element_id: The element Id. Returns: - int + The element reference side. """ - -def get_element_vertices(element_id: int) -> List[point_3d]: - """get element vertices +def get_element_vertices(element_id: ElementId) -> List[point_3d]: + """Gets the element vertices. Parameters: - element_id: element_id + element_id: The element Id. Returns: - List[point_3d] + The element vertice list. """ - -def get_element_facets(element_id: int) -> facet_list: - """get element facets +def get_element_facets(element_id: ElementId) -> facet_list: + """Gets the element facet list. Parameters: - element_id: element_id + element_id: The element Id. Returns: - facet_list + The element facet list. """ - -def get_list_width(element_id: int) -> float: - """get list width +def get_list_width(element_id: ElementId) -> float: + """Gets the element list width. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element list width. """ - -def get_list_height(element_id: int) -> float: - """get list height +def get_list_height(element_id: ElementId) -> float: + """Gets the element list height. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element list height. """ - -def get_list_length(element_id: int) -> float: - """get list length +def get_list_length(element_id: ElementId) -> float: + """Gets the element list length. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The element list length. """ - -def get_minimum_distance_between_elements(first_id: int, second_id: int) -> float: - """get minimum distance between elements +def get_minimum_distance_between_elements(first_id: ElementId, second_id: ElementId) -> float: + """Gets the minimum distance between 2 elements. Parameters: - first_id: first_id - second_id: second_id + first_id: The first element id. + second_id: The second element id. Returns: - float + The minimum distance. """ - -def get_total_area_of_all_faces(element: int) -> float: - """get total area of all faces +def get_total_area_of_all_faces(element_id: ElementId) -> float: + """Gets the total area of all faces for element. Parameters: - element: element + element_id: The element Id. Returns: - float + The element total faces area. """ - -def get_area_of_front_face(element: int) -> float: - """get area of front face +def get_area_of_front_face(element_id: ElementId) -> float: + """Gets the front face area for element. Parameters: - element: element + element_id: The element Id. Returns: - float + The element front face area. """ - -def get_door_surface(elements: List[int]) -> float: - """get door surface +def get_door_surface(element_id_list: List[ElementId]) -> float: + """Gets the element door surface. Parameters: - elements: elements + element_id_list: The element id list. Returns: - float + The element door surface. """ - -def get_window_surface(elements: List[int]) -> float: - """get window surface +def get_window_surface(element_id_list: List[ElementId]) -> float: + """Gets the element window surface. Parameters: - elements: elements + element_id_list: The element id list. Returns: - float + The element window surface. """ - def get_local_x() -> point_3d: - """get local x + """Gets the rotated global coordinate direction (X'). Returns: - point_3d + The local X vector. """ - def get_local_z() -> point_3d: - """get local z + """Gets the rotated global coordinate direction (Z'). Returns: - point_3d + The local Y vector. """ - def get_local_y() -> point_3d: - """get local y + """Gets the rotated global coordinate direction (Y'). Returns: - point_3d + The local Z vector. """ - -def get_drilling_tolerance(element: int) -> float: - """get drilling tolerance +def get_drilling_tolerance(element_id: ElementId) -> float: + """Gets the drilling tolerance of an axis. Parameters: - element: element + element_id: The element Id. Returns: - float + The drilling tolerance. """ - -def get_element_reference_face_vertices(element_id: int) -> List[point_3d]: - """get element reference face vertices +def get_element_reference_face_vertices(element_id: ElementId) -> List[point_3d]: + """Gets the vertices of the reference side. Parameters: - element_id: element_id + element_id: The element Id. Returns: - List[point_3d] + The vertexlist of all points. """ - -def get_element_reference_face_area(element_id: int) -> float: - """get element reference face area +def get_element_reference_face_area(element_id: ElementId) -> float: + """Gets the area of the reference side. Parameters: - element_id: element_id + element_id: The element Id. Returns: - float + The area(size) of reference face. """ - -def get_center_of_gravity_for_list(elements: List[int]) -> point_3d: - """get center of gravity for list +def get_center_of_gravity_for_list(element_id_list: List[ElementId]) -> point_3d: + """Gets the center of gravity for a list of elements. Parameters: - elements: elements + element_id_list: The list of element IDs. Returns: - point_3d + The center of gravity as a vector3D. """ - -def get_center_of_gravity_for_list_considering_materials(elements: List[int]) -> point_3d: - """get center of gravity for list considering materials +def get_center_of_gravity_for_list_considering_materials(element_id_list: List[ElementId]) -> point_3d: + """Gets the center of gravity for a list of elements, considering their materials. Parameters: - elements: elements + element_id_list: The list of element IDs. Returns: - point_3d + The center of gravity as a vector3D. """ - -def get_element_facet_count(element_id: int) -> int: - """get element facet count +def get_element_facet_count(element_id: ElementId) -> UnsignedInt: + """Gets the count of facets for a specific element. Parameters: - element_id: element_id + element_id: The ID of the element. Returns: - int + The count of facets. """ - -def get_weight_real(element_id: int) -> float: - """get weight real +def get_weight_real(element_id: ElementId) -> float: + """Gets the real weight of the element. Parameters: - element_id: element_id + element_id: The ID of the element. Returns: - float + The real weight of the element. """ - -def get_actual_physical_weight(element: int) -> float: - """get actual physical weight +def get_actual_physical_weight(element_id: ElementId) -> float: + """Gets the actual physical weight. Parameters: - element: element + element_id: The element id. Returns: - float + The actual physical weight. """ - -def get_actual_physical_volume(element_id: int) -> float: - """Gets actual physical volume (includes negative geometry operations, such as end-types, drillings, connectors, - openings, and MEP elements) (it might also take into account different drilling - bodies and counterbores in a connector) - +def get_actual_physical_volume(element_id: ElementId) -> float: + """Gets actual physical volume (includes negative geometry operations, such as end-types, drillings, connectors, openings, and MEP elements; it might also take into account different drilling bodies and counterbores in a connector). Parameters: - element_id: element_id + element_id: The element id. Returns: - float + The actual physical volume. """ - def are_facets_coplanar(first_facet: List[point_3d], second_facet: List[point_3d]) -> bool: - """are facets coplanar + """Tests if facets are coplanar. Parameters: - first_facet: first_facet - second_facet: second_facet + first_facet: The first facet. + second_facet: The second facet. Returns: - bool + True if facets are coplanar, false otherwise. """ - -def get_round_machine_rough_part_negative_width(element_id: int) -> bool: - """get round machine rough part negative width +def get_round_machine_rough_part_negative_width(element_id: ElementId) -> bool: + """Gets the value of option RoundMachineRoughPartNegativeWidth. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + The option RoundMachineRoughPartNegativeWidth value. """ - -def set_round_machine_rough_part_negative_width(elements: List[int], value: bool) -> None: - """set round machine rough part negative width +def set_round_machine_rough_part_negative_width(element_id_list: List[ElementId], value: bool) -> None: + """Sets the value of option RoundMachineRoughPartNegativeWidth. Parameters: - elements: elements - value: value - - Returns: - None + element_id_list: The element id list. + value: The new option RoundMachineRoughPartNegativeWidth value. """ - -def get_round_machine_rough_part_positive_width(element_id: int) -> bool: - """get round machine rough part positive width +def get_round_machine_rough_part_positive_width(element_id: ElementId) -> bool: + """Gets the value of option RoundMachineRoughPartPositiveWidth. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + The option RoundMachineRoughPartPositiveWidth value. """ - -def set_round_machine_rough_part_positive_width(elements: List[int], value: bool) -> None: - """set round machine rough part positive width +def set_round_machine_rough_part_positive_width(element_id_list: List[ElementId], value: bool) -> None: + """Sets the value of option RoundMachineRoughPartPositiveWidth. Parameters: - elements: elements - value: value - - Returns: - None + element_id_list: The element id list. + value: The new option RoundMachineRoughPartPositiveWidth value. """ - -def get_round_machine_rough_part_negative_height(element_id: int) -> bool: - """get round machine rough part negative height +def get_round_machine_rough_part_negative_height(element_id: ElementId) -> bool: + """Gets the value of option RoundMachineRoughPartNegativeHeight. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + The option RoundMachineRoughPartNegativeHeight value. """ - -def set_round_machine_rough_part_negative_height(elements: List[int], value: bool) -> None: - """set round machine rough part negative height +def set_round_machine_rough_part_negative_height(element_id_list: List[ElementId], value: bool) -> None: + """Sets the value of option RoundMachineRoughPartNegativeHeight. Parameters: - elements: elements - value: value - - Returns: - None + element_id_list: The element id list. + value: The new option RoundMachineRoughPartNegativeHeight value. """ - -def get_round_machine_rough_part_positive_height(element_id: int) -> bool: - """get round machine rough part positive height +def get_round_machine_rough_part_positive_height(element_id: ElementId) -> bool: + """Gets the value of option RoundMachineRoughPartPositiveHeight. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + The option RoundMachineRoughPartPositiveHeight value. """ - -def set_round_machine_rough_part_positive_height(elements: List[int], value: bool) -> None: - """set round machine rough part positive height +def set_round_machine_rough_part_positive_height(element_id_list: List[ElementId], value: bool) -> None: + """Sets the value of option RoundMachineRoughPartPositiveHeight. Parameters: - elements: elements - value: value - - Returns: - None + element_id_list: The element id list. + value: The new option RoundMachineRoughPartPositiveHeight options. """ - -def get_round_machine_rough_part_negative_length(element_id: int) -> bool: - """get round machine rough part negative length +def get_round_machine_rough_part_negative_length(element_id: ElementId) -> bool: + """Gets the value of option RoundMachineRoughPartNegativeLength. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + The option RoundMachineRoughPartNegativeLength value. """ - -def set_round_machine_rough_part_negative_length(elements: List[int], value: bool) -> None: - """set round machine rough part negative length +def set_round_machine_rough_part_negative_length(element_id_list: List[ElementId], value: bool) -> None: + """Sets the value of option RoundMachineRoughPartNegativeLength. Parameters: - elements: elements - value: value - - Returns: - None + element_id_list: The element id list. + value: The new option RoundMachineRoughPartNegativeLength value. """ - -def get_round_machine_rough_part_positive_length(element_id: int) -> bool: - """get round machine rough part positive length +def get_round_machine_rough_part_positive_length(element_id: ElementId) -> bool: + """Gets the value of option RoundMachineRoughPartPositiveLength. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + The option RoundMachineRoughPartPositiveLength value. """ - -def set_round_machine_rough_part_positive_length(elements: List[int], value: bool) -> None: - """set round machine rough part positive length +def set_round_machine_rough_part_positive_length(element_id_list: List[ElementId], value: bool) -> None: + """Sets the value of option RoundMachineRoughPartPositiveLength. Parameters: - elements: elements - value: value - - Returns: - None + element_id_list: The element id list. + value: The new option RoundMachineRoughPartPositiveLength value. """ - def get_standard_element_width_from_guid(standard_element_guid: str) -> float: - """get standard element width from guid + """Gets the standard element width from guid. Parameters: - standard_element_guid: standard_element_guid + standard_element_guid: The standard element guid. Returns: - float + The standard element width. """ - def get_standard_element_height_from_guid(standard_element_guid: str) -> float: - """get standard element height from guid + """Gets the standard element height from guid. Parameters: - standard_element_guid: standard_element_guid + standard_element_guid: The standard element guid. Returns: - float + The standard element height. """ - def get_standard_element_length_from_guid(standard_element_guid: str) -> float: - """get standard element length from guid + """Gets the standard element length from guid. Parameters: - standard_element_guid: standard_element_guid + standard_element_guid: The standard element guid. Returns: - float + The standard element length. """ - def get_standard_element_width_from_name(standard_element_name: str) -> float: - """get standard element width from name + """Gets the standard element width from name. Parameters: - standard_element_name: standard_element_name + standard_element_name: The standard element name. Returns: - float + The standard element width. """ - def get_standard_element_height_from_name(standard_element_name: str) -> float: - """get standard element height from name + """Gets the standard element height from name. Parameters: - standard_element_name: standard_element_name + standard_element_name: The standard element name. Returns: - float + The standard element height. """ - def get_standard_element_length_from_name(standard_element_name: str) -> float: - """get standard element length from name + """Gets the standard element length from name. Parameters: - standard_element_name: standard_element_name + standard_element_name: The standard element name. Returns: - float + The standard element length. """ From 4f744e9fa93bd263f027d19b827fddcca2ccb625 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 14:45:41 +0200 Subject: [PATCH 20/30] [API-519] Improved the list controller documentation --- src/list_controller/__init__.pyi | 166 +++++++++++-------------------- 1 file changed, 57 insertions(+), 109 deletions(-) diff --git a/src/list_controller/__init__.pyi b/src/list_controller/__init__.pyi index 8e1f5a9..5f92be7 100644 --- a/src/list_controller/__init__.pyi +++ b/src/list_controller/__init__.pyi @@ -1,174 +1,122 @@ from typing import List +from cadwork.api_types import ElementId, UnsignedInt -def export_production_list(element_id_list: List[int], file_path: str) -> None: - """Exports a production list +def export_production_list(element_id_list: List[ElementId], file_path: str) -> None: + """Exports a production list to the given file path. Parameters: - element_id_list: element_id_list - file_path: file_path - - Returns: - None + element_id_list: The list of element IDs to be exported. + file_path: The path of the target file for the export. """ - -def export_part_list(element_id_list: List[int], file_path: str) -> None: - """Exports a part list +def export_part_list(element_id_list: List[ElementId], file_path: str) -> None: + """Exports a part list to the specified file path. Parameters: - element_id_list: element_id_list - file_path: file_path - - Returns: - None + element_id_list: The list of element IDs to be exported. + file_path: The path of the target file for the export. """ - -def check_position_numbers_production_list() -> List[int]: - """Checks the production list numbers and returns the element ids with discrepancies +def check_position_numbers_production_list() -> List[ElementId]: + """Checks the production list numbers and returns the element IDs that have discrepancies. Returns: - element ids with discrepancies + The element IDs with discrepancies. """ - -def check_position_numbers_part_list() -> List[int]: - """Checks the part list numbers and returns the element ids with discrepancies +def check_position_numbers_part_list() -> List[ElementId]: + """Checks the part list numbers and returns the element IDs that have discrepancies. Returns: - element ids with discrepancies + The element IDs with discrepancies. """ - def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ - -def export_production_list_with_settings(element_id_list: List[int], file_path: str, settings_file_path: str) -> None: - """export production list with settings +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: - element_id_list: element_id_list - file_path: file_path - settings_file_path: settings_file_path - - Returns: - None + element_id_list: The list of element IDs to be exported. + file_path: The path of the target file for the export. + settings_file_path: The path to the settings file to be used for export. """ - -def export_part_list_with_settings(element_id_list: List[int], file_path: str, settings_file_path: str) -> None: - """export part list with settings +def export_part_list_with_settings(element_id_list: List[ElementId], file_path: str, settings_file_path: str) -> None: + """Exports a part list using an additional settings file. Parameters: - element_id_list: element_id_list - file_path: file_path - settings_file_path: settings_file_path - - Returns: - None + element_id_list: The list of element IDs to be exported. + file_path: The path of the target file for the export. + settings_file_path: The path to the settings file to be used for export. """ - -def generate_new_production_list_numbers(elements: List[int]) -> None: - """generate new production list numbers +def generate_new_production_list_numbers(element_id_list: List[ElementId]) -> None: + """Generates new production list numbers for the specified elements. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to generate numbers for. """ - -def generate_new_part_list_numbers(elements: List[int]) -> None: - """generate new part list numbers +def generate_new_part_list_numbers(element_id_list: List[ElementId]) -> None: + """Generates new part list numbers for the specified elements. Parameters: - elements: elements - - Returns: - None + element_id_list: The list of elements to generate numbers for. """ - def load_production_list_calculation_settings(settings_file_path: str) -> None: - """load production list calculation settings + """Loads the production list calculation settings from a file. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The path to the settings file to be loaded. """ - def load_part_list_calculation_settings(settings_file_path: str) -> None: - """load part list calculation settings + """Loads the part list calculation settings from a file. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The path to the settings file to be loaded. """ - -def generate_new_production_list_silently(elements: List[int], starting_number: int, keep_existing_numbers: bool, +def generate_new_production_list_silently(element_id_list: List[ElementId], starting_number: UnsignedInt, keep_existing_numbers: bool, with_containers: bool) -> None: - """generate new production list silently + """Generates new production list numbers silently starting from a given number, optionally keeping existing numbers and considering container elements. Parameters: - elements: elements - starting_number: starting_number - keep_existing_numbers: keep_existing_numbers - with_containers: with_containers - - Returns: - None + element_id_list: The list of elements to generate numbers for. + starting_number: The number from which to start assigning new numbers. + keep_existing_numbers: Whether or not to retain already assigned numbers in the list. + with_containers: Whether to include container elements in the number generation. """ - -def generate_new_part_list_silently(elements: List[int], starting_number: int, keep_existing_numbers: bool, +def generate_new_part_list_silently(element_id_list: List[ElementId], starting_number: UnsignedInt, keep_existing_numbers: bool, with_containers: bool) -> None: - """generate new part list silently + """Generates new part list numbers silently starting from a given number, optionally keeping existing numbers and considering container elements. Parameters: - elements: elements - starting_number: starting_number - keep_existing_numbers: keep_existing_numbers - with_containers: with_containers - - Returns: - None + element_id_list: The list of elements to generate numbers for. + starting_number: The number from which to start assigning new numbers. + keep_existing_numbers: Whether or not to retain already assigned numbers in the list. + with_containers: Whether to include container elements in the number generation. """ - -def export_cover_list(element_id_list: List[int], file_path: str) -> None: - """Exports a Wall/Roof/Floor list +def export_cover_list(element_id_list: List[ElementId], file_path: str) -> None: + """Exports a Wall, Roof, or Floor list to the specified file path. Parameters: - element_id_list: element_id_list - file_path: file_path - - Returns: - None + element_id_list: The list of element IDs to be exported. + file_path: The path of the target file for the export. """ - -def export_cover_list_with_settings(element_id_list: List[int], file_path: str, settings_file_path: str) -> None: - """Exports a Wall/Roof/Floor list with settings file +def export_cover_list_with_settings(element_id_list: List[ElementId], file_path: str, settings_file_path: str) -> None: + """Exports a Wall, Roof, or Floor list to the specified file path using an additional settings file. Parameters: - element_id_list: element_id_list - file_path: file_path - settings_file_path: settings_file_path - - Returns: - None + element_id_list: The list of element IDs to be exported. + file_path: The path of the target file for the export. + settings_file_path: The path to the settings file to be used for export. """ From 22f4c63d0a7c89508fae1b69fd43c7bafe9906dd Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 14:58:54 +0200 Subject: [PATCH 21/30] [API-519] Improved the machine controller documentation --- src/machine_controller/__init__.pyi | 187 ++++++++++++---------------- 1 file changed, 79 insertions(+), 108 deletions(-) diff --git a/src/machine_controller/__init__.pyi b/src/machine_controller/__init__.pyi index 799d7c3..585ba29 100644 --- a/src/machine_controller/__init__.pyi +++ b/src/machine_controller/__init__.pyi @@ -1,13 +1,17 @@ from typing import List from cadwork import vertex_list +from cadwork.api_types import ElementId +from cadwork.btl_version import btl_version +from cadwork.hundegger_machine_type import hundegger_machine_type +from cadwork.weinmann_mfb_version import weinmann_mfb_version -def export_btl(btl_version: int, file_path: str) -> None: - """Exports a BTL file +def export_btl(btl_version: btl_version, file_path: str) -> None: + """Exports a BTL file. Parameters: - btl_version: btl_version - file_path: file_path + btl_version: The BTL version. + file_path: The export file path. Examples: >>> import cadwork @@ -16,32 +20,26 @@ def export_btl(btl_version: int, file_path: str) -> None: >>> btl_version = cadwork.btl_version.btlx_2_1.value >>> output_path = "C:/exports/timber_project.btlx" >>> mc.export_btl(btl_version, output_path) - - Returns: - None """ -def export_weinmann_mfb(mfb_version: int) -> None: - """Exports a WUP file +def export_weinmann_mfb(mfb_version: weinmann_mfb_version) -> None: + """Exports a Weinmann MFB file. Parameters: - mfb_version: mfb_version + mfb_version: The Weinmann MFB version. Examples: >>> import machine_controller as mc >>> mfb_version = cadwork.weinmann_mfb_version.wup_3_4.value >>> mc.export_weinmann_mfb(mfb_version) - - Returns: - None """ -def export_hundegger(hundeggertype: int) -> None: - """Exports a Hundegger file +def export_hundegger(hundeggertype: hundegger_machine_type) -> None: + """Exports a Hundegger file. Parameters: - hundeggertype: hundeggertype + hundeggertype: The Hundegger machine type. Examples: >>> import cadwork @@ -49,17 +47,14 @@ def export_hundegger(hundeggertype: int) -> None: >>> hundegger_type = cadwork.hundegger_machine_type.k2.value >>> mc.export_hundegger(hundegger_type) - - Returns: - None """ -def export_hundegger_with_file_path(hundeggertype: int, file_path: str) -> None: - """Exports a Hundegger file +def export_hundegger_with_file_path(hundeggertype: hundegger_machine_type, file_path: str) -> None: + """Exports a Hundegger file. Parameters: - hundeggertype: hundeggertype - file_path: file_path + hundeggertype: The Hundegger machine type. + file_path: The export file path. Examples: >>> import cadwork @@ -68,18 +63,15 @@ def export_hundegger_with_file_path(hundeggertype: int, file_path: str) -> None: >>> hundegger_type = cadwork.hundegger_machine_type.k2.value >>> output_path = "C:/exports/hundegger_project.k2" >>> mc.export_hundegger_with_file_path(hundegger_type, output_path) - - Returns: - None """ -def export_hundegger_with_file_path_and_presetting(hundeggertype: int, file_path: str, presetting: str) -> None: - """Exports a Hundegger file +def export_hundegger_with_file_path_and_presetting(hundeggertype: hundegger_machine_type, file_path: str, presetting: str) -> None: + """Exports a Hundegger file. Parameters: - hundeggertype: hundeggertype - file_path: file_path - presetting: presetting + hundeggertype: The Hundegger machine type. + file_path: The export file path. + presetting: The presetting file path (.xml). Examples: >>> import cadwork @@ -89,18 +81,15 @@ def export_hundegger_with_file_path_and_presetting(hundeggertype: int, file_path >>> output_path = r"C:/exports/hundegger_project.k2" >>> presetting_file = r"...3d/Machine/Hundegger/K2/hundegger_settings.xml" >>> mc.export_hundegger_with_file_path_and_presetting(hundegger_type, output_path, presetting_file) - - Returns: - None """ -def export_btl_with_presetting(btl_version: int, file_path: str, presetting: str) -> None: - """Exports a BTL file with a presetting file +def export_btl_with_presetting(btl_version: btl_version, file_path: str, presetting: str) -> None: + """Exports a BTL file with a presetting file. Parameters: - btl_version: btl_version - file_path: file_path - presetting: presetting + btl_version: The BTL version. + file_path: The export file path. + presetting: The presetting file path (.xml). Examples: >>> import cadwork @@ -110,17 +99,14 @@ def export_btl_with_presetting(btl_version: int, file_path: str, presetting: str >>> output_path = r"C:/exports/timber_project.btlx" >>> presetting_file = r"...3d/Machine/BTL/btl_settings.xml" >>> mc.export_btl_with_presetting(btl_version, output_path, presetting_file) - - Returns: - None """ -def calculate_btl_machine_data(elements: List[int], btl_version: int) -> None: - """Calculates the Machine Data for BTL +def calculate_btl_machine_data(element_id_list: List[ElementId], btl_version: btl_version) -> None: + """Calculates the Machine Data for BTL. Parameters: - elements: elements - btl_version: btl_version + element_id_list: The list of element Id. + btl_version: The BTL version. Examples: >>> import cadwork @@ -130,17 +116,14 @@ def calculate_btl_machine_data(elements: List[int], btl_version: int) -> None: >>> beam_elements = ec.get_all_identifiable_element_ids() >>> btl_version = cadwork.btl_version.btlx_2_1.value >>> mc.calculate_btl_machine_data(beam_elements, btl_version) - - Returns: - None """ -def calculate_hundegger_machine_data(elements: List[int], hunderggertype: int) -> None: - """Calculates the Machine Data for Hundegger +def calculate_hundegger_machine_data(element_id_list: List[ElementId], hundeggertype: hundegger_machine_type) -> None: + """Calculates the Machine Data for Hundegger. Parameters: - elements: elements - hunderggertype: hunderggertype + element_id_list: The list of element Id. + hundeggertype: The Hundegger machine type. Examples: >>> import cadwork @@ -150,28 +133,22 @@ def calculate_hundegger_machine_data(elements: List[int], hunderggertype: int) - >>> beam_elements = ec.get_all_identifiable_element_ids() >>> hundegger_type = cadwork.hundegger_machine_type.k2.value >>> mc.calculate_hundegger_machine_data(beam_elements, hundegger_type) - - Returns: - None """ -def load_hundegger_calculation_set(hundeggertype: int, file_path: str) -> None: - """load hundegger calculation set +def load_hundegger_calculation_set(hundeggertype: hundegger_machine_type, file_path: str) -> None: + """Loads the Hundegger calculation set. Parameters: - hundeggertype: hundeggertype - file_path: file_path - - Returns: - None + hundeggertype: The Hundegger machine type. + file_path: The file path of the calculation set. """ -def export_hundegger_with_file_path_silent(hundeggertype: int, file_path: str) -> None: - """Exports a Hundegger file silently +def export_hundegger_with_file_path_silent(hundeggertype: hundegger_machine_type, file_path: str) -> None: + """Exports a Hundegger file silently. Parameters: - hundeggertype: hundeggertype - file_path: file_path + hundeggertype: The Hundegger machine type. + file_path: The export file path. Examples: >>> import cadwork @@ -180,18 +157,15 @@ def export_hundegger_with_file_path_silent(hundeggertype: int, file_path: str) - >>> hundegger_type = cadwork.hundegger_machine_type.k2.value >>> output_path = r"C:/exports/hundegger_project.k2" >>> mc.export_hundegger_with_file_path_silent(hundegger_type, output_path) - - Returns: - None """ -def export_hundegger_with_file_path_and_presetting_silent(hundeggertype: int, file_path: str, presetting: str) -> None: - """Exports a Hundegger file silently +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: - hundeggertype: hundeggertype - file_path: file_path - presetting: presetting + hundeggertype: The Hundegger machine type. + file_path: The export file path. + presetting: The presetting file path (.xml). Examples: >>> import cadwork @@ -201,18 +175,15 @@ def export_hundegger_with_file_path_and_presetting_silent(hundeggertype: int, fi >>> output_path = r"C:/exports/hundegger_project.k2" >>> presetting_file = r"...3d/Machine/Hundegger/K2/hundegger_settings.xml" >>> mc.export_hundegger_with_file_path_and_presetting_silent(hundegger_type, output_path, presetting_file) - - Returns: - None """ -def get_element_hundegger_processings(element_id: int, hundeggertype: int) -> List[int]: - """Get Hundegger processing IDs for an element. +def get_element_hundegger_processings(element_id: ElementId, hundeggertype: hundegger_machine_type) -> List[ElementId]: + """Gets the list of Hundegger processings for a specific element. Parameters: - element_id: The element ID. - hundeggertype: The Hundegger type. + element_id: The element id. + hundeggertype: The Hundegger machine type. Examples: >>> import cadwork @@ -225,15 +196,15 @@ def get_element_hundegger_processings(element_id: int, hundeggertype: int) -> Li >>> print(f"Found {len(processings)} Hundegger processings") Returns: - List of processing IDs. + A list of element IDs representing the processings. """ -def get_element_btl_processings(element_id: int, btl_version: int) -> List[int]: - """Get BTL processing IDs for an element. +def get_element_btl_processings(element_id: ElementId, btl_version: btl_version) -> List[ElementId]: + """Gets the list of BTL processings for a specific element. Parameters: - element_id: The element ID. + element_id: The element id. btl_version: The BTL version. Examples: @@ -247,16 +218,16 @@ def get_element_btl_processings(element_id: int, btl_version: int) -> List[int]: >>> print(f"Found {len(processings)} BTL processings") Returns: - List of processing IDs. + A list of element IDs representing the processings. """ -def get_processing_name(reference_element_id: int, processing_id: int) -> str: - """Get the name of a processing. +def get_processing_name(reference_element_id: ElementId, processing_id: ElementId) -> str: + """Gets the name of a specific processing. Parameters: - reference_element_id: The reference element ID. - processing_id: The processing ID. + reference_element_id: The reference element id. + processing_id: The processing id. Examples: >>> import cadwork @@ -269,16 +240,16 @@ def get_processing_name(reference_element_id: int, processing_id: int) -> str: >>> name = mc.get_processing_name(element, processing) Returns: - The processing name. + The name of the processing. """ -def get_processing_code(reference_element_id: int, processing_id: int) -> str: - """Get the code of a processing. +def get_processing_code(reference_element_id: ElementId, processing_id: ElementId) -> str: + """Gets the code of a specific processing. Parameters: - reference_element_id: The reference element ID. - processing_id: The processing ID. + reference_element_id: The reference element id. + processing_id: The processing id. Examples: >>> import cadwork @@ -291,16 +262,16 @@ def get_processing_code(reference_element_id: int, processing_id: int) -> str: >>> code = mc.get_processing_code(element, processing) Returns: - The processing code. + The code of the processing. """ -def get_processing_points(reference_element_id: int, processing_id: int) -> vertex_list: - """Get the points of a processing. +def get_processing_points(reference_element_id: ElementId, processing_id: ElementId) -> vertex_list: + """Gets the points of a specific processing. Parameters: - reference_element_id: The reference element ID. - processing_id: The processing ID. + reference_element_id: The reference element id. + processing_id: The processing id. Examples: >>> import cadwork @@ -313,16 +284,16 @@ def get_processing_points(reference_element_id: int, processing_id: int) -> vert >>> points = mc.get_processing_points(element, processing) Returns: - A vertex_list of points. + A list of vertices representing the points of the processing. """ -def get_processing_btl_parameter_set(reference_element_id: int, processing_id: int) -> List[str]: - """Get the BTL parameter set for a 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. Parameters: - reference_element_id: The reference element ID. - processing_id: The processing ID. + reference_element_id: The reference element id. + processing_id: The processing id. Examples: >>> import cadwork @@ -335,5 +306,5 @@ def get_processing_btl_parameter_set(reference_element_id: int, processing_id: i >>> parameters = mc.get_processing_btl_parameter_set(element, processing) Returns: - List of BTL parameter strings. - """ + A list of strings representing the BTL parameter set of the processing. + """ \ No newline at end of file From 770f1b1107470643cdb45eaeb029f8c8a4a5f9bc Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 15:24:40 +0200 Subject: [PATCH 22/30] [API-519] Improved the material controller documentation --- src/material_controller/__init__.pyi | 753 ++++++++++++--------------- 1 file changed, 320 insertions(+), 433 deletions(-) diff --git a/src/material_controller/__init__.pyi b/src/material_controller/__init__.pyi index 275d7da..7a905a4 100644 --- a/src/material_controller/__init__.pyi +++ b/src/material_controller/__init__.pyi @@ -1,874 +1,761 @@ from typing import List +from cadwork.api_types import MaterialId, UnsignedInt -def create_material(name: str) -> int: - """Creates new material +def create_material(name: str) -> MaterialId: + """Creates new material. Parameters: - name: name + name: The material name. Returns: - material ID + The material id. """ -def set_name(material_id: int, name: str) -> None: - """Sets the material name +def set_name(material_id: MaterialId, name: str) -> None: + """Sets the material name. Parameters: - material_id: material_id - name: name - - Returns: - None + material_id: The material id. + name: The material name. """ -def set_group(material_id: int, group: str) -> None: - """Sets the material group +def set_group(material_id: MaterialId, group: str) -> None: + """Sets the material group. Parameters: - material_id: material_id - group: group - - Returns: - None + material_id: The material id. + group: The material group. """ -def set_code(material_id: int, code: str) -> None: - """Sets the material code +def set_code(material_id: MaterialId, code: str) -> None: + """Sets the material code. Parameters: - material_id: material_id - code: code - - Returns: - None + material_id: The material id. + code: The material code. """ -def set_modulus_elasticity_1(material_id: int, modulus_elasticity1: float) -> None: - """Sets the material modulus of elasticity 1 +def set_modulus_elasticity_1(material_id: MaterialId, modulus_elasticity1: float) -> None: + """Sets the material modulus of elasticity 1. Parameters: - material_id: material_id - modulus_elasticity1: modulus_elasticity1 - - Returns: - None + material_id: The material id. + modulus_elasticity1: The material modulus of elasticity 1. """ -def set_modulus_elasticity_2(material_id: int, modulus_elasticity2: float) -> None: - """Sets the material modulus of elasticity 2 +def set_modulus_elasticity_2(material_id: MaterialId, modulus_elasticity2: float) -> None: + """Sets the material modulus of elasticity 2. Parameters: - material_id: material_id - modulus_elasticity2: modulus_elasticity2 - - Returns: - None + material_id: The material id. + modulus_elasticity2: The material modulus of elasticity 2. """ -def set_modulus_elasticity_3(material_id: int, modulus_elasticity3: float) -> None: - """Sets the material modulus of elasticity 3 +def set_modulus_elasticity_3(material_id: MaterialId, modulus_elasticity3: float) -> None: + """Sets the material modulus of elasticity 3. Parameters: - material_id: material_id - modulus_elasticity3: modulus_elasticity3 - - Returns: - None + material_id: The material id. + modulus_elasticity3: The material modulus of elasticity 3. """ -def set_shear_modulus_1(material_id: int, shear_modulus1: float) -> None: - """Sets the material shear modulus 1 +def set_shear_modulus_1(material_id: MaterialId, shear_modulus1: float) -> None: + """Sets the material shear modulus 1. Parameters: - material_id: material_id - shear_modulus1: shear_modulus1 - - Returns: - None + material_id: The material id. + shear_modulus1: The material shear modulus 1. """ -def set_shear_modulus_2(material_id: int, shear_modulus2: float) -> None: - """Sets the material shear modulus 2 +def set_shear_modulus_2(material_id: MaterialId, shear_modulus2: float) -> None: + """Sets the material shear modulus 2. Parameters: - material_id: material_id - shear_modulus2: shear_modulus2 - - Returns: - None + material_id: The material id. + shear_modulus2: The material shear modulus 2. """ -def set_price(material_id: int, price: float) -> None: - """Sets the material price +def set_price(material_id: MaterialId, price: float) -> None: + """Sets the material price. Parameters: - material_id: material_id - price: price - - Returns: - None + material_id: The material id. + price: The material price. """ -def set_price_type(material_id: int, price_type: str) -> None: - """Sets the material price type +def set_price_type(material_id: MaterialId, price_type: str) -> None: + """Sets the material price type. Parameters: - material_id: material_id - price_type: price_type - - Returns: - None + material_id: The material id. + price_type: The material price type. """ -def set_thermal_conductivity(material_id: int, thermal_conductivity: float) -> None: - """Sets the material thermal conductivity +def set_thermal_conductivity(material_id: MaterialId, thermal_conductivity: float) -> None: + """Sets the material thermal conductivity. Parameters: - material_id: material_id - thermal_conductivity: thermal_conductivity - - Returns: - None + material_id: The material id. + thermal_conductivity: The material thermal conductivity. """ -def set_heat_capacity(material_id: int, heat_capacity: float) -> None: - """Sets the material heat capacity +def set_heat_capacity(material_id: MaterialId, heat_capacity: float) -> None: + """Sets the material heat capacity. Parameters: - material_id: material_id - heat_capacity: heat_capacity - - Returns: - None + material_id: The material id. + heat_capacity: The material heat capacity. """ -def set_u_min(material_id: int, u_min: float) -> None: - """Sets the material U min +def set_u_min(material_id: MaterialId, u_min: float) -> None: + """Sets the material U min. Parameters: - material_id: material_id - u_min: u_min - - Returns: - None + material_id: The material id. + u_min: The material U min. """ -def set_u_max(material_id: int, u_max: float) -> None: - """Sets the material U max +def set_u_max(material_id: MaterialId, u_max: float) -> None: + """Sets the material U max. Parameters: - material_id: material_id - u_max: u_max - - Returns: - None + material_id: The material id. + u_max: The material U max. """ -def set_fire_resistance_class(material_id: int, fire_resistance_class: str) -> None: - """Sets the material fire resistance class +def set_fire_resistance_class(material_id: MaterialId, fire_resistance_class: str) -> None: + """Sets the material fire resistance class. Parameters: - material_id: material_id - fire_resistance_class: fire_resistance_class - - Returns: - None + material_id: The material id. + fire_resistance_class: The material fire resistance class. """ -def set_smoke_class(material_id: int, smoke_class: str) -> None: - """Sets the material smoke class +def set_smoke_class(material_id: MaterialId, smoke_class: str) -> None: + """Sets the material smoke class. Parameters: - material_id: material_id - smoke_class: smoke_class - - Returns: - None + material_id: The material id. + smoke_class: The material smoke class. """ -def set_drop_forming_class(material_id: int, drop_forming_class: str) -> None: - """Sets the material drop forming class +def set_drop_forming_class(material_id: MaterialId, drop_forming_class: str) -> None: + """Sets the material drop forming class. Parameters: - material_id: material_id - drop_forming_class: drop_forming_class - - Returns: - None + material_id: The material id. + drop_forming_class: The material drop forming class. """ -def set_burn_off_rate(material_id: int, burn_off_rate: float) -> None: - """Sets the material burn-off rate +def set_burn_off_rate(material_id: MaterialId, burn_off_rate: float) -> None: + """Sets the material burn-off rate. Parameters: - material_id: material_id - burn_off_rate: burn_off_rate - - Returns: - None + material_id: The material id. + burn_off_rate: The material burn off rate. """ -def set_weight(material_id: int, weight: float) -> None: - """Sets the material weight +def set_weight(material_id: MaterialId, weight: float) -> None: + """Sets the material weight. Parameters: - material_id: material_id - weight: weight - - Returns: - None + material_id: The material id. + weight: The material weight. """ -def set_weight_type(material_id: int, weight_type: str) -> None: - """Sets the material weight type +def set_weight_type(material_id: MaterialId, weight_type: str) -> None: + """Sets the material weight type. Parameters: - material_id: material_id - weight_type: weight_type - - Returns: - None + material_id: The material id. + weight_type: The material weight type. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ -def set_grade(material_id: int, grade: str) -> None: - """set grade +def set_grade(material_id: MaterialId, grade: str) -> None: + """Sets the grade of a material. Parameters: - material_id: material_id - grade: grade - - Returns: - None + material_id: The material id. + grade: The grade to set. """ -def set_quality(material_id: int, quality: str) -> None: - """set quality +def set_quality(material_id: MaterialId, quality: str) -> None: + """Sets the quality of a material. Parameters: - material_id: material_id - quality: quality - - Returns: - None + material_id: The material id. + quality: The quality to set. """ -def set_composition(material_id: int, composition: str) -> None: - """set composition +def set_composition(material_id: MaterialId, composition: str) -> None: + """Sets the composition of a material. Parameters: - material_id: material_id - composition: composition - - Returns: - None + material_id: The material id. + composition: The composition to set. """ -def get_material_id(material_name: str) -> int: - """Gets the material with a given name +def get_material_id(material_name: str) -> MaterialId: + """Gets the material with a given name. Parameters: - material_name: material_name + material_name: The material name. Returns: - material ID + The material id. """ -def get_name(material_id: int) -> str: - """Gets the material name +def get_name(material_id: MaterialId) -> str: + """Gets the material name. Parameters: - material_id: material_id + material_id: The material id. Returns: - material name + The material name. """ -def get_group(material_id: int) -> str: - """Gets the material group +def get_group(material_id: MaterialId) -> str: + """Gets the material group. Parameters: - material_id: material_id + material_id: The material id. Returns: - material group + The material group. """ -def get_code(material_id: int) -> str: - """Gets the material code +def get_code(material_id: MaterialId) -> str: + """Gets the material code. Parameters: - material_id: material_id + material_id: The material id. Returns: - material code + The material code. """ -def get_modulus_elasticity_1(material_id: int) -> float: - """Gets the material modulus of elasticity 1 +def get_modulus_elasticity_1(material_id: MaterialId) -> float: + """Gets the material modulus of elasticity 1. Parameters: - material_id: material_id + material_id: The material id. Returns: - material modulus of elasticity 1 + The material modulus of elasticity 1. """ -def get_modulus_elasticity_2(material_id: int) -> float: - """Gets the material modulus of elasticity 2 +def get_modulus_elasticity_2(material_id: MaterialId) -> float: + """Gets the material modulus of elasticity 2. Parameters: - material_id: material_id + material_id: The material id. Returns: - material modulus of elasticity 2 + The material modulus of elasticity 2. """ -def get_modulus_elasticity_3(material_id: int) -> float: - """Gets the material modulus of elasticity 3 +def get_modulus_elasticity_3(material_id: MaterialId) -> float: + """Gets the material modulus of elasticity 3. Parameters: - material_id: material_id + material_id: The material id. Returns: - material modulus of elasticity 3 + The material modulus of elasticity 3. """ -def get_shear_modulus_1(material_id: int) -> float: - """Gets the material shear modulus 1 +def get_shear_modulus_1(material_id: MaterialId) -> float: + """Gets the material shear modulus 1. Parameters: - material_id: material_id + material_id: The material id. Returns: - material shear modulus 1 + The material shear modulus 1. """ -def get_shear_modulus_2(material_id: int) -> float: - """Gets the material shear modulus 2 +def get_shear_modulus_2(material_id: MaterialId) -> float: + """Gets the material shear modulus 2. Parameters: - material_id: material_id + material_id: The material id. Returns: - material shear modulus 2 + The material shear modulus 2. """ -def get_price(material_id: int) -> float: - """Gets the material price +def get_price(material_id: MaterialId) -> float: + """Gets the material price. Parameters: - material_id: material_id + material_id: The material id. Returns: - material price + The material price. """ -def get_price_type(material_id: int) -> str: - """Sets the material price type +def get_price_type(material_id: MaterialId) -> str: + """Gets the material price type. Parameters: - material_id: material_id + material_id: The material id. Returns: - material price type + The material price type. """ -def get_thermal_conductivity(material_id: int) -> float: - """Gets the material thermal conductivity +def get_thermal_conductivity(material_id: MaterialId) -> float: + """Gets the material thermal conductivity. Parameters: - material_id: material_id + material_id: The material id. Returns: - material thermal conductivity + The material thermal conductivity. """ -def get_heat_capacity(material_id: int) -> float: - """Gets the material heat capacity +def get_heat_capacity(material_id: MaterialId) -> float: + """Gets the material heat capacity. Parameters: - material_id: material_id + material_id: The material id. Returns: - material heat capacity + The material heat capacity. """ -def get_u_min(material_id: int) -> float: - """Gets the material U min +def get_u_min(material_id: MaterialId) -> float: + """Gets the material U min. Parameters: - material_id: material_id + material_id: The material id. Returns: - material U min + The material U min. """ -def get_u_max(material_id: int) -> float: - """Gets the material U max +def get_u_max(material_id: MaterialId) -> float: + """Gets the material U max. Parameters: - material_id: material_id + material_id: The material id. Returns: - material U max + The material U max. """ -def get_fire_resistance_class(material_id: int) -> str: - """Gets the material fire resistance class +def get_fire_resistance_class(material_id: MaterialId) -> str: + """Gets the material fire resistance class. Parameters: - material_id: material_id + material_id: The material id. Returns: - material fire resistance class + The material fire resistance class. """ -def get_smoke_class(material_id: int) -> str: - """Gets the material smoke class +def get_smoke_class(material_id: MaterialId) -> str: + """Gets the material smoke class. Parameters: - material_id: material_id + material_id: The material id. Returns: - material smoke class + The material smoke class. """ -def get_drop_forming_class(material_id: int) -> str: - """Gets the material drop forming class +def get_drop_forming_class(material_id: MaterialId) -> str: + """Gets the material drop forming class. Parameters: - material_id: material_id + material_id: The material id. Returns: - material drop forming class + The material drop forming class. """ -def get_burn_off_rate(material_id: int) -> float: - """Gets the material burn-off rate +def get_burn_off_rate(material_id: MaterialId) -> float: + """Gets the material burn-off rate. Parameters: - material_id: material_id + material_id: The material id. Returns: - material burn off rate + The material burn off rate. """ -def get_weight(material_id: int) -> float: - """Gets the material weight +def get_weight(material_id: MaterialId) -> float: + """Gets the material weight. Parameters: - material_id: material_id + material_id: The material id. Returns: - material weight + The material weight. """ -def get_weight_type(material_id: int) -> str: - """Gets the material weight type +def get_weight_type(material_id: MaterialId) -> str: + """Gets the material weight type. Parameters: - material_id: material_id + material_id: The material id. Returns: - material weight type + The material weight type. """ -def get_all_materials() -> List[int]: - """Gets all the materials +def get_all_materials() -> List[MaterialId]: + """Retrieves a list of all materials. Returns: - material ID list + A list of all material id. """ -def get_grade(material_id: int) -> str: - """get grade +def get_grade(material_id: MaterialId) -> str: + """Gets the grade of a material. Parameters: - material_id: material_id + material_id: The material id. Returns: - str + The grade of the material. """ -def get_quality(material_id: int) -> str: - """get quality +def get_quality(material_id: MaterialId) -> str: + """Gets the quality of a material. Parameters: - material_id: material_id + material_id: The material id. Returns: - str + The quality of the material. """ -def get_composition(material_id: int) -> str: - """get composition +def get_composition(material_id: MaterialId) -> str: + """Gets the composition of a material. Parameters: - material_id: material_id + material_id: The material id. Returns: - str + The composition of the material. """ -def get_short_name(material_id: int) -> str: - """get short name +def get_short_name(material_id: MaterialId) -> str: + """Gets the short name of a material. Parameters: - material_id: material_id + material_id: The material id. Returns: - str + The short name of the material. """ -def get_all_material_groups() -> List[str]: - """Gets all the material groups +def get_all_material_groups() -> List[MaterialId]: + """Retrieves a list of all material groups. Returns: - group names + A list of all material group names. """ def get_parent_group(group: str) -> str: - """Gets the parent group of a material group + """Gets the parent group of a given group. Parameters: - group: group + group: The name of the group. Returns: - parent group name + The name of the parent group. """ -def get_material_color_assignment_for_nodes(color_nr: int) -> int: - """get material color assignment for nodes +def get_material_color_assignment_for_nodes(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for nodes. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for nodes. """ -def set_material_color_assignment_for_nodes(color_nr: int, material_id: int) -> None: - """set material color assignment for nodes +def set_material_color_assignment_for_nodes(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the material color assignment for nodes. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for nodes. """ -def get_material_color_assignment_for_standard_axes(color_nr: int) -> int: - """get material color assignment for standard axes +def get_material_color_assignment_for_standard_axes(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for standard axes. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for standard axes. """ -def set_material_color_assignment_for_standard_axes(color_nr: int, material_id: int) -> None: - """set material color assignment 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. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for standard axes. """ -def get_material_color_assignment_for_drillings(color_nr: int) -> int: - """get material color assignment for drillings +def get_material_color_assignment_for_drillings(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for drillings. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for drillings. """ -def set_material_color_assignment_for_drillings(color_nr: int, material_id: int) -> None: - """set material color assignment for drillings +def set_material_color_assignment_for_drillings(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the material color assignment for drillings. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for drillings. """ -def get_material_color_assignment_for_mep_axes(color_nr: int) -> int: - """get material color assignment for mep axes +def get_material_color_assignment_for_mep_axes(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for MEP axes. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for MEP axes. """ -def set_material_color_assignment_for_mep_axes(color_nr: int, material_id: int) -> None: - """set material color assignment 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. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for MEP axes. """ -def get_material_color_assignment_for_beams(color_nr: int) -> int: - """get material color assignment for beams +def get_material_color_assignment_for_beams(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for beams. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for beams. """ -def set_material_color_assignment_for_beams(color_nr: int, material_id: int) -> None: - """set material color assignment for beams +def set_material_color_assignment_for_beams(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the material color assignment for beams. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for beams. """ -def get_material_color_assignment_for_panels(color_nr: int) -> int: - """get material color assignment for panels +def get_material_color_assignment_for_panels(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for panels. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for panels. """ -def set_material_color_assignment_for_panels(color_nr: int, material_id: int) -> None: - """set material color assignment for panels +def set_material_color_assignment_for_panels(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the material color assignment for panels. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for panels. """ -def get_material_color_assignment_for_auxiliary_elements(color_nr: int) -> int: - """get material color assignment for auxiliary elements +def get_material_color_assignment_for_auxiliary_elements(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for auxiliary elements. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for auxiliary elements. """ -def set_material_color_assignment_for_auxiliary_elements(color_nr: int, material_id: int) -> None: - """set material color assignment 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. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for auxiliary elements. """ -def get_material_color_assignment_for_surfaces(color_nr: int) -> int: - """get material color assignment for surfaces +def get_material_color_assignment_for_surfaces(color_nb: UnsignedInt) -> MaterialId: + """Gets the material color assignment for surfaces. Parameters: - color_nr: color_nr + color_nb: The color number. [1-255] Returns: - int + The material id assigned to the color number for surfaces. """ -def set_material_color_assignment_for_surfaces(color_nr: int, material_id: int) -> None: - """set material color assignment for surfaces +def set_material_color_assignment_for_surfaces(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the material color assignment for surfaces. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color number. [1-255] + material_id: The material ID to assign to the color number for surfaces. """ -def get_texture_color(material_id: int) -> int: - """get texture color +def get_texture_color(material_id: MaterialId) -> int: + """Gets the texture color for a given material ID. Parameters: - material_id: material_id + material_id: The material id. Returns: - int + The color of the texture. [1-255] """ -def set_texture_color(color_nr: int, material_id: int) -> None: - """set texture color +def set_texture_color(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the texture color for a given material ID. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The color to set for the texture. [1-255] + material_id: The material id. """ -def get_texture_transparency(material_id: int) -> int: - """get texture transparency +def get_texture_transparency(material_id: MaterialId) -> int: + """Gets the texture transparency for a given material ID. Parameters: - material_id: material_id + material_id: The material id. Returns: - int + The transparency of the texture. """ -def set_texture_transparency(color_nr: int, material_id: int) -> None: - """set texture transparency +def set_texture_transparency(color_nb: UnsignedInt, material_id: MaterialId) -> None: + """Sets the texture transparency for a given material ID. Parameters: - color_nr: color_nr - material_id: material_id - - Returns: - None + color_nb: The transparency to set for the texture. + material_id: The material id. """ -def get_texture_rotation_angle(material_id: int) -> float: - """get texture rotation angle +def get_texture_rotation_angle(material_id: MaterialId) -> float: + """Gets the texture rotation angle for a given material ID. Parameters: - material_id: material_id + material_id: The material id. Returns: - float + The rotation angle of the texture. """ -def set_texture_rotation_angle(material_id: int, angle: float) -> None: - """set texture rotation angle +def set_texture_rotation_angle(material_id: MaterialId, angle: float) -> None: + """Sets the texture rotation angle for a given material ID. Parameters: - material_id: material_id - angle: angle - - Returns: - None + material_id: The material id. + angle: The rotation angle to set for the texture. """ -def get_texture_length_alignment(material_id: int) -> bool: - """get texture length alignment +def get_texture_length_alignment(material_id: MaterialId) -> bool: + """Gets the texture length alignment for a given material ID. Parameters: - material_id: material_id + material_id: The material id. Returns: - bool + True if Texture Random Placement is enabled, false otherwise. """ -def set_texture_length_alignment(material_id: int, flag: bool) -> None: - """set texture length alignment +def set_texture_length_alignment(material_id: MaterialId, flag: bool) -> None: + """Sets the texture length alignment for a given material ID. Parameters: - material_id: material_id - flag: flag - - Returns: - None + material_id: The material id. + flag: True if Texture Random Placement is enabled, false otherwise. """ -def get_texture_zoom_x(material_id: int) -> float: - """get texture zoom x +def get_texture_zoom_x(material_id: MaterialId) -> float: + """Gets the texture zoom factor in the X direction for a given material ID. Parameters: - material_id: material_id + material_id: The material id. Returns: - float + The zoom factor of the texture in the X direction. """ -def set_texture_zoom_x(material_id: int, value: float) -> None: - """set texture zoom x +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. Parameters: - material_id: material_id - value: value - - Returns: - None + material_id: The material id. + value: The zoom factor to set in the X direction. """ -def get_texture_zoom_y(material_id: int) -> float: - """get texture zoom y +def get_texture_zoom_y(material_id: MaterialId) -> float: + """Gets the texture zoom factor in the Y direction for a given material ID. Parameters: - material_id: material_id + material_id: The material id. Returns: - float + The zoom factor of the texture in the Y direction. """ -def set_texture_zoom_y(material_id: int, value: float) -> None: - """set texture zoom y +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: material_id - value: value - - Returns: - None - """ + material_id: The material id. + value: The zoom factor to set. + """ \ No newline at end of file From 1cf14d138271e4a0ad3c5813d561ef273c85075f Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 15:45:45 +0200 Subject: [PATCH 23/30] [API-519] Improved the menu controller documentation --- src/menu_controller/__init__.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/menu_controller/__init__.pyi b/src/menu_controller/__init__.pyi index 20a125e..5bb45ef 100644 --- a/src/menu_controller/__init__.pyi +++ b/src/menu_controller/__init__.pyi @@ -2,12 +2,12 @@ from typing import List def display_simple_menu(menu_items: List[str]) -> str: - """display simple menu + """Displays a simple menu. Parameters: - menu_items: menu_items + menu_items: The menu items. Returns: - str + The selected menu item. """ From 475ce5d3f8111a909eb16f11a9e1e5d46a3e1a7b Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 15:48:28 +0200 Subject: [PATCH 24/30] [API-519] Improved the layer cover controller documentation --- src/multi_layer_cover_controller/__init__.pyi | 314 ++++++++---------- 1 file changed, 131 insertions(+), 183 deletions(-) diff --git a/src/multi_layer_cover_controller/__init__.pyi b/src/multi_layer_cover_controller/__init__.pyi index 4d8a358..ee46e45 100644 --- a/src/multi_layer_cover_controller/__init__.pyi +++ b/src/multi_layer_cover_controller/__init__.pyi @@ -1,111 +1,92 @@ from typing import List +from cadwork.api_types import * +from cadwork.multi_layer_type import multi_layer_type - -def set_element_multi_layer_set(element_id: int, set_id: int) -> None: - """Sets the multi layer set id of a cover +def set_element_multi_layer_set(element_id: ElementId, set_id: MultiLayerSetId) -> None: + """Sets the multi layer set id of a cover. Parameters: - element_id: element_id - set_id: set_id - + element_id: The element id of the cover. + set_id: The multi layer set id. + Examples: >>> cover_id = element.create_cover(points, normal_vector) >>> multi_layer_set_id = mlc.create_multi_layer_wall("Wall Type A") >>> mlc.set_element_multi_layer_set(cover_id, multi_layer_set_id) - - Returns: - None """ - -def set_multi_layer_set_name(set_id: int, set_name: str) -> None: - """Sets the name for a multi layer set +def set_multi_layer_set_name(set_id: MultiLayerSetId, set_name: str) -> None: + """Sets the name for a multi layer set. Parameters: - set_id: set_id - set_name: set_name - + set_id: The multi layer set id. + set_name: The multi layer set name. + Examples: >>> multi_layer_set_id = mlc.create_multi_layer_wall("Default Wall") >>> mlc.set_multi_layer_set_name(multi_layer_set_id, "Exterior Wall Type B") - - Returns: - None """ - -def set_cover_name(set_id: int, cover_name: str) -> None: - """Sets the cover name of the multi layer set +def set_cover_name(set_id: MultiLayerSetId, cover_name: str) -> None: + """Sets the cover name of the multi layer set. Parameters: - set_id: set_id - cover_name: cover_name - + set_id: The multi layer set id. + cover_name: The cover name. + Examples: >>> multi_layer_set_id = mlc.create_multi_layer_wall("Default Wall") >>> mlc.set_cover_name(multi_layer_set_id, "Exterior Facade") - - Returns: - None """ - -def set_cover_material(set_id: int, cover_material: int) -> None: - """Sets the cover material of the multi layer set +def set_cover_material(set_id: MultiLayerSetId, cover_material: MaterialId) -> None: + """Sets the cover material of the multi layer set. Parameters: - set_id: set_id - cover_material: cover_material - + set_id: The multi layer set id. + cover_material: The cover material. + Examples: >>> multi_layer_set_id = mlc.create_multi_layer_wall("Default Wall") >>> material_id = mc.get_material_id("Cement Board") >>> mlc.set_cover_material(multi_layer_set_id, material_id) - - Returns: - None """ - -def set_cover_thickness(set_id: int, cover_thickness: float) -> None: - """Sets the cover thickness of the multi layer set. Only allowed for simple walls (cover without layer) +def set_cover_thickness(set_id: MultiLayerSetId, cover_thickness: float) -> None: + """Sets the cover thickness of the multi layer set. Only allowed for simple walls (cover without layer). Parameters: - set_id: set_id - cover_thickness: cover_thickness - + set_id: The multi layer set id. + cover_thickness: The cover thickness. + Examples: >>> multi_layer_set_id = mlc.create_multi_layer_wall("Simple Wall") >>> mlc.set_cover_thickness(multi_layer_set_id, 150.0) - - Returns: - None """ -def create_multi_layer_wall(set_name: str) -> int: - """Creates a new multi layer wall with given name and default values +def create_multi_layer_wall(set_name: str) -> MultiLayerSetId: + """Creates a new multi layer wall with given name and default values. Parameters: - set_name: set_name - + set_name: The multi layer set name. + Examples: >>> wall_set_id = mlc.create_multi_layer_wall("Exterior Insulated Wall") >>> print(f"Created new multi-layer wall with ID: {wall_set_id}") Returns: - multiLayerSetID + The multi layer set id. """ - -def add_layer(set_id: int, layer_type: int, name: str, material_id: int, thickness: float) -> None: - """Adds a new layer to the multi layer set +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: - set_id: set_id - layer_type: layer_type - name: name - material_id: material_id - thickness: thickness + set_id: The multi layer set id. + layer_type: The type of the layer. + name: The name of the layer. + material_id: The material id of the layer. + thickness: The thickness of the layer. Examples: >>> material_id_1 = mc.get_material_id("material_1") @@ -113,105 +94,82 @@ def add_layer(set_id: int, layer_type: int, name: str, material_id: int, thickne >>> multi_layer_set_id = mlc.create_multi_layer_wall("MultiLayerWall") >>> layer1_thickness = 200 >>> layer2_thickness = 15 - >>> mlc.add_layer(multi_layer_set_id, cadwork.multi_layer_type.structure.value,"Layer1", material_id_1, layer1_thickness) - >>> mlc.add_layer(multi_layer_set_id, cadwork.multi_layer_type.panel.value,"Layer2", material_id_2, layer2_thickness) - - Returns: - None + >>> mlc.add_layer(multi_layer_set_id, cadwork.multi_layer_type.structure.value, "Layer1", material_id_1, layer1_thickness) + >>> mlc.add_layer(multi_layer_set_id, cadwork.multi_layer_type.panel.value, "Layer2", material_id_2, layer2_thickness) """ - -def set_layer_name(set_id: int, layer_index: int, name: str) -> None: - """Sets the name of a layer of the multi layer set +def set_layer_name(set_id: MultiLayerSetId, layer_index: UnsignedInt, name: str) -> None: + """Sets the name of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - name: name - + set_id: The multi layer set id. + layer_index: The layer index. + name: The name of the layer. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> mlc.set_layer_name(multi_layer_set_id, 0, "Exterior Cladding") >>> mlc.set_layer_name(multi_layer_set_id, 1, "Insulation Layer") - - Returns: - None """ - -def set_layer_material(set_id: int, layer_index: int, material_id: int) -> None: - """Sets the material of a layer of the multi layer set +def set_layer_material(set_id: MultiLayerSetId, layer_index: UnsignedInt, material_id: MaterialId) -> None: + """Sets the material of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - material_id: material_id - + set_id: The multi layer set id. + layer_index: The layer index. + material_id: The material id of the layer. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> insulation_material_id = mc.get_material_id("Mineral Wool") >>> mlc.set_layer_material(multi_layer_set_id, 1, insulation_material_id) - - Returns: - None """ - -def set_layer_thickness(set_id: int, layer_index: int, thickness: float) -> None: - """Sets the thickness of a layer of the multi layer set +def set_layer_thickness(set_id: MultiLayerSetId, layer_index: UnsignedInt, thickness: float) -> None: + """Sets the thickness of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - thickness: thickness - + set_id: The multi layer set id. + layer_index: The layer index. + thickness: The layer thickness. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> mlc.set_layer_thickness(multi_layer_set_id, 0, 25.0) # Set first layer to 25mm >>> mlc.set_layer_thickness(multi_layer_set_id, 1, 120.0) # Set second layer to 120mm - - Returns: - None """ - -def set_layer_type(set_id: int, layer_index: int, layer_type: int) -> None: - """Sets the type of a layer of the multi layer set +def set_layer_type(set_id: MultiLayerSetId, layer_index: UnsignedInt, layer_type: multi_layer_type) -> None: + """Sets the type of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - layer_type: layer_type + set_id: The multi layer set id. + layer_index: The layer index. + layer_type: The layer type. Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> layer_count = mlc.get_layer_count(multi_layer_set_id) >>> layer_mid_point_idx = layer_count // 2 >>> mlc.set_layer_type(multi_layer_set_id, layer_mid_point_idx, cadwork.multi_layer_type.structure.value) - - Returns: - None """ - -def set_cover_color(set_id: int, cover_color: int) -> None: - """Sets the cover color of the multi layer set +def set_cover_color(set_id: MultiLayerSetId, cover_color: ColorId) -> None: + """Sets the cover color of the multi layer set. Parameters: - set_id: set_id - cover_color: cover_color - + set_id: The multi layer set id. + cover_color: The cover color. + Examples: >>> multi_layer_set_id = mlc.create_multi_layer_wall("Default Wall") >>> blue_color_id = vc.get_color_id("blue") >>> mlc.set_cover_color(multi_layer_set_id, blue_color_id) - - Returns: - None """ -def get_multi_layer_walls() -> List[int]: - """Gets all multi layer wall ids +def get_multi_layer_walls() -> List[MultiLayerSetId]: + """Gets all multi layer wall ids. Examples: >>> wall_ids = mlc.get_multi_layer_walls() @@ -221,31 +179,30 @@ def get_multi_layer_walls() -> List[int]: ... print(f"Wall ID: {wall_id}, Name: {name}") Returns: - List[int] + The multi layer wall ids. """ - -def get_multi_layer_set_name(set_id: int) -> str: - """Gets the name for a multi layer set +def get_multi_layer_set_name(set_id: MultiLayerSetId) -> str: + """Gets the name for a multi layer set. Parameters: - set_id: set_id - + set_id: The multi layer set id. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> set_name = mlc.get_multi_layer_set_name(multi_layer_set_id) >>> print(f"Element uses multi-layer definition: {set_name}") Returns: - string + The multi layer set name. """ -def get_element_multi_layer_set(element_id: int) -> int: - """Gets the multi layer set id of a cover +def get_element_multi_layer_set(element_id: ElementId) -> MultiLayerSetId: + """Gets the multi layer set id of a cover. Parameters: - element_id: element_id - + element_id: The element id of the cover. + Examples: >>> cover_ids = element.get_covers() >>> for cover_id in cover_ids: @@ -254,32 +211,30 @@ def get_element_multi_layer_set(element_id: int) -> int: ... print(f"Cover {cover_id} uses wall type: {set_name}") Returns: - multiLayerSetID + The multi layer set id. """ - -def get_cover_name(set_id: int) -> str: - """Gets the cover name defined in the multi layer set +def get_cover_name(set_id: MultiLayerSetId) -> str: + """Gets the cover name defined in the multi layer set. Parameters: - set_id: set_id - + set_id: The multi layer set id. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> cover_name = mlc.get_cover_name(multi_layer_set_id) >>> print(f"Cover name: {cover_name}") Returns: - string + The cover name. """ - -def get_cover_material(set_id: int) -> int: - """Gets the cover material defined in the multi layer set +def get_cover_material(set_id: MultiLayerSetId) -> MaterialId: + """Gets the cover material defined in the multi layer set. Parameters: - set_id: set_id - + set_id: The multi layer set id. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> material_id = mlc.get_cover_material(multi_layer_set_id) @@ -287,49 +242,46 @@ def get_cover_material(set_id: int) -> int: >>> print(f"Cover uses material: {material_name}") Returns: - materialID + The cover material. """ - -def get_cover_thickness(set_id: int) -> float: - """Gets the cover thickness of the multi layer set +def get_cover_thickness(set_id: MultiLayerSetId) -> float: + """Gets the cover thickness of the multi layer set. Parameters: - set_id: set_id - + set_id: The multi layer set id. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> thickness = mlc.get_cover_thickness(multi_layer_set_id) >>> print(f"Cover thickness: {thickness}mm") Returns: - double + The cover thickness. """ - -def get_layer_count(set_id: int) -> int: - """Gets the Number of Layers of the multi layer set +def get_layer_count(set_id: MultiLayerSetId) -> UnsignedInt: + """Gets the number of layers of the multi layer set. Parameters: - set_id: set_id - + set_id: The multi layer set id. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> count = mlc.get_layer_count(multi_layer_set_id) >>> print(f"Wall has {count} layers") Returns: - uint64_t + The number of layers. """ - -def get_layer_name(set_id: int, layer_index: int) -> str: - """Gets the name of a layer of the multi layer set +def get_layer_name(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> str: + """Gets the name of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - + set_id: The multi layer set id. + layer_index: The layer index. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> layer_count = mlc.get_layer_count(multi_layer_set_id) @@ -338,17 +290,16 @@ def get_layer_name(set_id: int, layer_index: int) -> str: ... print(f"Layer {i}: {layer_name}") Returns: - string + The layer name. """ - -def get_layer_thickness(set_id: int, layer_index: int) -> float: - """Gets the thickness of a layer of the multi layer set +def get_layer_thickness(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> float: + """Gets the thickness of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - + set_id: The multi layer set id. + layer_index: The layer index. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> layer_count = mlc.get_layer_count(multi_layer_set_id) @@ -360,17 +311,16 @@ def get_layer_thickness(set_id: int, layer_index: int) -> float: >>> print(f"Total wall thickness: {total_thickness}mm") Returns: - double + The layer thickness. """ - -def get_layer_material(set_id: int, layer_index: int) -> int: - """Gets the material of a layer of the multi layer set +def get_layer_material(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> MaterialId: + """Gets the material of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - + set_id: The multi layer set id. + layer_index: The layer index. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> layer_count = mlc.get_layer_count(multi_layer_set_id) @@ -380,17 +330,16 @@ def get_layer_material(set_id: int, layer_index: int) -> int: ... print(f"Layer {i} material: {material_name}") Returns: - string + The layer material. """ - -def get_layer_type(set_id: int, layer_index: int) -> int: - """Gets the type of a layer of the multi layer set +def get_layer_type(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> multi_layer_type: + """Gets the type of a layer of the multi layer set. Parameters: - set_id: set_id - layer_index: layer_index - + set_id: The multi layer set id. + layer_index: The layer index. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> layer_count = mlc.get_layer_count(multi_layer_set_id) @@ -401,16 +350,15 @@ def get_layer_type(set_id: int, layer_index: int) -> int: ... print(f"Layer {i} ({layer_name}): Type = {type_str}") Returns: - multiLayerType + The layer type. """ - -def get_cover_color(set_id: int) -> int: - """Gets the cover color defined in the multi layer set +def get_cover_color(set_id: MultiLayerSetId) -> ColorId: + """Gets the cover color defined in the multi layer set. Parameters: - set_id: set_id - + set_id: The multi layer set id. + Examples: >>> multi_layer_set_id = mlc.get_element_multi_layer_set(element_id) >>> color_id = mlc.get_cover_color(multi_layer_set_id) @@ -418,5 +366,5 @@ def get_cover_color(set_id: int) -> int: >>> print(f"Cover uses color: {color_name}") Returns: - colorID + The cover color. """ From 29f8e5cc9ce050065afef9df8cc3ac819b21aaa9 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 16:13:42 +0200 Subject: [PATCH 25/30] [API-519] Improved the roof controller documentation --- src/roof_controller/__init__.pyi | 64 ++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/src/roof_controller/__init__.pyi b/src/roof_controller/__init__.pyi index b39daa0..73e22c0 100644 --- a/src/roof_controller/__init__.pyi +++ b/src/roof_controller/__init__.pyi @@ -1,37 +1,71 @@ from typing import List +from cadwork.api_types import ElementId -def get_profile_length(element_id: int) -> float: - """Gets the profile length +def get_profile_length(element_id: ElementId) -> float: + """Gets the profile length. Parameters: - element_id: element_id + element_id: The element id. Returns: - profile length + The profile length. """ -def get_edge_length(element_id: int, edge_type: str) -> float: - """Gets the edge length +def get_edge_length(element_id: ElementId, edge_type: str) -> float: + """Gets the edge length. Parameters: - element_id: element_id - edge_type: edge_type + element_id: The element id. + edge_type: The edge type : + + + - "none" + + - "ridge" + + - "eave" + + - "vergeright" + - "vergeleft" + - "vergeoblique" + + - "hip" + + - "valley" + + - "userdefined1" + - "userdefined2" + + - "userdefinedmitrejoint1" + - "userdefinedmitrejoint2" + + - "wallconnection" + - "wallconnectionright" + - "wallconnectionleft" + - "wallconnectiontop" + - "wallconnectionbottom" + + - "roofcutout" + - "roofcutoutright" + - "roofcutoutleft" + - "roofcutouttop" + - "roofcutoutbottom" + + - "roofedgeontoproofsurface" + - "roofedgeonbottomroofsurface" Returns: - edge length + The edge length. """ -def get_all_caddy_element_ids() -> List[int]: +def get_all_caddy_element_ids() -> List[ElementId]: """Gets all caddy elements Returns: - element ID list + The list of all caddy element id. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ From a182792936794791e9b6b6d5b4531c10309a5bf1 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Fri, 22 Aug 2025 16:34:16 +0200 Subject: [PATCH 26/30] [API-519] Improved the scene controller documentation --- src/scene_controller/__init__.pyi | 142 +++++++++++++----------------- 1 file changed, 63 insertions(+), 79 deletions(-) diff --git a/src/scene_controller/__init__.pyi b/src/scene_controller/__init__.pyi index 2e3f75f..9f34ffd 100644 --- a/src/scene_controller/__init__.pyi +++ b/src/scene_controller/__init__.pyi @@ -1,177 +1,161 @@ from typing import List +from cadwork.api_types import * def add_scene(name: str) -> bool: - """Adds a new scene + """Adds a new scene. Parameters: - name: name + name: The scene name. Returns: - did operation succeed + True if the operation succeeded, false otherwise. """ def rename_scene(old_name: str, new_name: str) -> bool: - """Renames a scene + """Renames a scene. Parameters: - old_name: old_name - new_name: new_name + old_name: The old scene name. + new_name: The new scene name. Returns: - did operation succeed + True if the operation succeeded, false otherwise. """ def delete_scene(name: str) -> bool: - """Deletes a scene + """Deletes a scene. Parameters: - name: name + name: The scene name. Returns: - did operation succeed + True if the operation succeeded, false otherwise. """ -def add_elements_to_scene(name: str, element_i_ds: List[int]) -> bool: - """Adds elements to a scene +def add_elements_to_scene(name: str, element_id_list: List[ElementId]) -> bool: + """Adds elements to a scene. Parameters: - name: name - element_i_ds: element_i_ds + name: The scene name. + element_id_list:: The element id list. Returns: - did operation succeed + True if the operation succeeded, false otherwise. """ -def remove_elements_from_scene(name: str, element_i_ds: List[int]) -> bool: - """Removes elements from a scene +def remove_elements_from_scene(name: str, element_id_list: List[ElementId]) -> bool: + """Removes elements from a scene. Parameters: - name: name - element_i_ds: element_i_ds + name: The scene name. + element_id_list:: The element id list. Returns: - did operation succeed + True if the operation succeeded, false otherwise. """ -def get_elements_from_scene(name: str) -> List[int]: - """Gets the elements from a scene +def get_elements_from_scene(name: str) -> List[ElementId]: + """Gets the elements from a scene. Parameters: - name: name + name: The scene name. Returns: - element ID list + The element id list. """ def activate_scene(name: str) -> bool: - """Activates a scene + """Activates a scene. Parameters: - name: name + name: The scene name. Returns: - did operation succeed + True if the operation succeeded, false otherwise. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ def get_scene_list() -> List[str]: - """get scene list + """Gets the list of scenes. Returns: - List[str] + The list of scene names. """ - -def group_scences(scene_names: List[str]) -> int: - """group scences +def group_scences(scene_names: List[str]) -> UnsignedInt: + """Groups the scenes to a scene group. Parameters: - scene_names: scene_names + scene_names: The scene names. Returns: - int + The index of the new group. """ - -def ungroup_scences(group_index: int) -> None: - """ungroup scences +def ungroup_scences(group_index: UnsignedInt) -> None: + """Deletes the group of scenes. Parameters: - group_index: group_index - - Returns: - None + group_index: The index of the group. """ def is_scene_present(name: str) -> bool: - """Queries of scene with name is present + """Checks if a scene is present. Parameters: - name: name + name: The name of the scene to check. Returns: - presence of scene + True if the scene is present, false otherwise. """ def set_group_tab_color(scene_group_name: str, red: int, green: int, blue: int) -> None: - """set group tab color + # TODO : Missing alpha parameter + """Sets the group tab color. Parameters: - scene_group_name: scene_group_name - red: red - green: green - blue: blue - - Returns: - None + scene_group_name: The name of the scene group. + red: Red component. + green: Green component. + blue: Blue component. """ def rename_scene_group(old_name: str, new_name: str) -> None: - """rename scene group + """Renames a scene group. Parameters: - old_name: old_name - new_name: new_name - - Returns: - None + old_name: The old scene group name. + new_name: The new scene group name. """ -def get_group_index_by_name(scene_group_name: str) -> int: - """get group index by name +def get_group_index_by_name(scene_group_name: str) -> UnsignedInt: + """Gets the index of a scene group by its name. Parameters: - scene_group_name: scene_group_name + scene_group_name: The group name. Returns: - int + The index of the group, or a maximum uint64_t if not found. """ -def rename_scene_group_by_index(group_index: int, new_name: str) -> None: - """rename scene group by index +def rename_scene_group_by_index(group_index: UnsignedInt, new_name: str) -> None: + """Renames a scene group by its index. Parameters: - group_index: group_index - new_name: new_name - - Returns: - None + group_index: The index of the group. + new_name: The new scene group name. """ - -def group_scences_with_name(scene_names: List[str], group_name: str) -> int: - """group scences with name +def group_scences_with_name(scene_names: List[str], group_name: str) -> UnsignedInt: + """Groups the scenes to a scene group and sets the name of the new group. Parameters: - scene_names: scene_names - group_name: group_name + scene_names: The scene names to group. + group_name: The name of the new group. Returns: - int + The index of the new group. """ From e70827b34c95b78b7d9fcc90b8c7e3a029bea446 Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Mon, 25 Aug 2025 08:46:09 +0200 Subject: [PATCH 27/30] [API-519] Improved the shop drawing controller documentation --- src/shop_drawing_controller/__init__.pyi | 174 ++++++++--------------- 1 file changed, 60 insertions(+), 114 deletions(-) diff --git a/src/shop_drawing_controller/__init__.pyi b/src/shop_drawing_controller/__init__.pyi index 54b253e..9b14315 100644 --- a/src/shop_drawing_controller/__init__.pyi +++ b/src/shop_drawing_controller/__init__.pyi @@ -1,194 +1,140 @@ from typing import List from cadwork.point_3d import point_3d +from cadwork.api_types import * -def export_2d_wireframe_with_clipboard(clipboard_number: int, with_layout: bool) -> None: - """Exports a 2D wireframe to the clipboard +def export_2d_wireframe_with_clipboard(clipboard_number: UnsignedInt, with_layout: bool) -> None: + """Exports a 2D wireframe to the clipboard. Parameters: - clipboard_number: clipboard_number - with_layout: with_layout - - Returns: - None + clipboard_number: The clipboard number. + with_layout: Use layout, false by default. """ -def export_2d_hidden_lines_with_clipboard(clipboard_number: int, with_layout: bool) -> None: - """Exports a 2D hidden lines to the clipboard +def export_2d_hidden_lines_with_clipboard(clipboard_number: UnsignedInt, with_layout: bool) -> None: + """Exports a 2D hidden lines to the clipboard. Parameters: - clipboard_number: clipboard_number - with_layout: with_layout - - Returns: - None + clipboard_number: The clipboard number. + with_layout: Use layout, false by default. """ def export_2d_wireframe_with_2dc(file_path: str, with_layout: bool) -> None: - """Exports a 2D wireframe to a 2DC file + """Exports a 2D wireframe to a 2DC file. Parameters: - file_path: file_path - with_layout: with_layout - - Returns: - None + file_path: The export file path. + with_layout: Use layout, false by default. """ def export_2d_hidden_lines_with_2dc(file_path: str, with_layout: bool) -> None: - """Exports a 2D hidden lines to a 2DC file + """Exports a 2D hidden lines to a 2DC file. Parameters: - file_path: file_path - with_layout: with_layout - - Returns: - None + file_path: The export file path. + with_layout: Use layout, false by default. """ -def export_wall_with_clipboard(clipboard_number: int, element_id_list: List[int]) -> None: - """Exports a wall to the clipboard +def export_wall_with_clipboard(clipboard_number: UnsignedInt, element_id_list: List[ElementId]) -> None: + """Exports a wall to the clipboard. Parameters: - clipboard_number: clipboard_number - element_id_list: element_id_list - - Returns: - None + clipboard_number: The clipboard number. + element_id_list: The elements to export. """ -def export_export_solid_with_clipboard(clipboard_number: int, element_id_list: List[int]) -> None: - """Exports an export solid to the clipboard +def export_export_solid_with_clipboard(clipboard_number: UnsignedInt, element_id_list: List[ElementId]) -> None: + """Exports an export solid to the clipboard. Parameters: - clipboard_number: clipboard_number - element_id_list: element_id_list - - Returns: - None + clipboard_number: The clipboard number. + element_id_list: The elements to export. """ -def export_piece_by_piece_with_clipboard(clipboard_number: int, element_id_list: List[int]) -> None: - """Exports a piece-by-piece to the clipboard +def export_piece_by_piece_with_clipboard(clipboard_number: UnsignedInt, element_id_list: List[ElementId]) -> None: + """Exports a piece-by-piece to the clipboard. Parameters: - clipboard_number: clipboard_number - element_id_list: element_id_list - - Returns: - None + clipboard_number: The clipboard number. + element_id_list: The elements to export. """ -def assign_export_solid(ceo_element: List[int], element_id_list: List[int]) -> None: - """Assigns elements to an export solid +def assign_export_solid(ceo_element_id_list: List[ElementId], element_id_list: List[ElementId]) -> None: + """Assigns elements to an export solid. Parameters: - ceo_element: ceo_element - element_id_list: element_id_list - - Returns: - None + ceo_element_id_list: The export solid to assign. + element_id_list: The elements to assign. """ -def export_container_with_clipboard(clipboard_number: int, elements: List[int]) -> None: - """Export a container to the clipboard +def export_container_with_clipboard(clipboard_number: UnsignedInt, element_id_list: List[ElementId]) -> None: + """Export a container to the clipboard. Parameters: - clipboard_number: clipboard_number - elements: elements - - Returns: - None + clipboard_number: The clipboard number. + element_id_list: The elements to export. """ -def add_wall_section_horizontal(element: int, position: point_3d) -> None: - """Adds a horizontal wall section +def add_wall_section_horizontal(element_id: ElementId, position: point_3d) -> None: + """Adds a horizontal wall section. Parameters: - element: element - position: position - - Returns: - None + element_id: The element id. + position: The section position. """ -def add_wall_section_vertical(element: int, position: point_3d) -> None: - """Adds a vertical wall section +def add_wall_section_vertical(element_id: ElementId, position: point_3d) -> None: + """Adds a vertical wall section. Parameters: - element: element - position: position - - Returns: - None + element_id: The element id. + position: The section position. """ -def export_wall_with_clipboard_and_presetting(clipboard_number: int, element_id_list: List[int], presetting_file: str) -> None: - """Exports a wall to the clipboard +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: - clipboard_number: clipboard_number - element_id_list: element_id_list - presetting_file: presetting_file - - Returns: - None + clipboard_number: The clipboard number. + element_id_list: The element id list to export. + presetting_file: The presetting file path. """ def load_export_piece_by_piece_settings(settings_file_path: str) -> None: - """Loads piece by piece export settings + """Loads piece by piece export settings. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The settings file path. """ def save_export_piece_by_piece_settings(settings_file_path: str) -> None: - """Saves piece by piece export settings + """Saves piece by piece export settings. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The settings file path. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ def load_export_wall_settings(settings_file_path: str) -> None: - """Loads wall export settings + """Loads wall export settings. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The settings file path. """ def load_export_solid_settings(settings_file_path: str) -> None: - """Loads export solid settings + """Loads export solid settings. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The settings file path. """ def load_export_container_settings(settings_file_path: str) -> None: - """Loads container export settings + """Loads container export settings. Parameters: - settings_file_path: settings_file_path - - Returns: - None - """ - + settings_file_path: The settings file path. + """ \ No newline at end of file From abbc4388c74e67ebb20925d3ebeb91ad1c3af4dd Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Mon, 25 Aug 2025 14:20:57 +0200 Subject: [PATCH 28/30] [API-519] Improved the visualization controller documentation --- src/visualization_controller/__init__.pyi | 444 ++++++++-------------- 1 file changed, 154 insertions(+), 290 deletions(-) diff --git a/src/visualization_controller/__init__.pyi b/src/visualization_controller/__init__.pyi index ad1c9b6..6f61614 100644 --- a/src/visualization_controller/__init__.pyi +++ b/src/visualization_controller/__init__.pyi @@ -1,572 +1,436 @@ from typing import List from cadwork.camera_data import camera_data from cadwork.point_3d import point_3d +from cadwork.api_types import * +from cadwork.rgb_color import rgb_color -def set_color(element_id_list: List[int], color_id: int) -> None: - """Sets the element color +def set_color(element_id_list: List[ElementId], color_id: ColorId) -> None: + """Sets the element color. Parameters: - element_id_list: element_id_list - color_id: color_id - - Returns: - None + element_id_list: The list of element id. + color_id: The color ID to set. """ -def set_opengl_color(element_id_list: List[int], color: None) -> None: - """Sets the element OpenGL color +def set_opengl_color(element_id_list: List[ElementId], color: rgb_color) -> None: + """Sets the element OpenGL color. Parameters: - element_id_list: element_id_list - color: color - - Returns: - None + element_id_list: The list of element id. + color: The OpenGL color to set. """ -def is_active(element_id: int) -> bool: - """Tests if element is active +def is_active(element_id: ElementId) -> bool: + """Tests if element is active. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element active + True if the element is active, false otherwise. """ -def set_active(element_id_list: List[int]) -> None: - """Sets element active +def set_active(element_id_list: List[ElementId]) -> None: + """Sets element active. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ -def set_inactive(element_id_list: List[int]) -> None: - """Sets the element inactive +def set_inactive(element_id_list: List[ElementId]) -> None: + """Sets the element inactive. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ -def is_visible(element_id: int) -> bool: - """Tests if element is visible +def is_visible(element_id: ElementId) -> bool: + """Tests if element is visible. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element visible + True if the element is visible, false otherwise. """ -def set_visible(element_id_list: List[int]) -> None: - """Sets the element visible +def set_visible(element_id_list: List[ElementId]) -> None: + """Sets the element visible. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ -def set_invisible(element_id_list: List[int]) -> None: - """Sets the element invisible +def set_invisible(element_id_list: List[ElementId]) -> None: + """Sets the element invisible. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ -def is_immutable(element_id: int) -> bool: - """Tests if the element is immutable +def is_immutable(element_id: ElementId) -> bool: + """Tests if the element is immutable. Parameters: - element_id: element_id + element_id: The element id. Returns: - is element immutable + True if the element is immutable, false otherwise. """ -def set_immutable(element_id_list: List[int]) -> None: - """Sets the element immutable +def set_immutable(element_id_list: List[ElementId]) -> None: + """Sets the element immutable. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ -def set_mutable(element_id_list: List[int]) -> None: - """Sets the element mutable +def set_mutable(element_id_list: List[ElementId]) -> None: + """Sets the element mutable. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ def show_all_elements() -> None: - """Shows all elements - - Returns: - None + """Shows all elements. """ def hide_all_elements() -> None: - """Hides all elements - - Returns: - None + """Hides all elements. """ def zoom_all_elements() -> None: - """Zooms on all elements - - Returns: - None + """Zooms on all elements. """ def zoom_active_elements() -> None: - """Zooms on all active elements - - Returns: - None + """Zooms on all active elements. """ def refresh() -> None: - """Refresh the drawing area - - Returns: - None + """Refresh the drawing area. """ -def set_material(element_id_list: List[int], element_id: int) -> None: - """Sets the element material +def set_material(element_id_list: List[ElementId], element_id: ElementId) -> None: + """Sets the element material. Parameters: - element_id_list: element_id_list - element_id: element_id - - Returns: - None + element_id_list: The list of element id. + element_id: The material ID to set. """ def save_visibility_state() -> "visibility_state": - """Saves the visibility state + """Saves the visibility state. Returns: - visibility state + The visibility state. """ def restore_visibility_state(state: None) -> None: - """Restores the visibility state + """Restores the visibility state. Parameters: - state: state - - Returns: - None + state: The visibility state to restore. """ def save_activation_state() -> "activation_state": - """Saves the activation state + """Saves the activation state. Returns: - activation state + The activation state. """ def restore_activation_state(state: None) -> None: - """Restores the activation state + """Restores the activation state. Parameters: - state: state - - Returns: - None + state: The activation state to restore. """ def show_view_positive_x() -> None: - """Sets the view to +X - - Returns: - None + """Sets the view to +X. """ def show_view_negative_x() -> None: - """Sets the view to -X - - Returns: - None + """Sets the view to -X. """ def show_view_positive_y() -> None: - """Sets the view to +Y - - Returns: - None + """Sets the view to +Y. """ def show_view_negative_y() -> None: - """Sets the view to -Y - - Returns: - None + """Sets the view to -Y. """ def show_view_positive_z() -> None: - """Sets the view to +Z - - Returns: - None + """Sets the view to +Z. """ def show_view_negative_z() -> None: - """Sets the view to -Z - - Returns: - None + """Sets the view to -Z. """ def show_view_standard_axo() -> None: - """Sets the view to standard axonometry - - Returns: - None + """Sets the view to standard axonometry. """ def show_view_wireframe() -> None: - """Sets the view to wireframe - - Returns: - None + """Sets the view to wireframe. """ def show_view_hidden_lines() -> None: - """Sets the view to hidden lines - - Returns: - None + """Sets the view to hidden lines. """ def show_view_dashed_hidden_lines() -> None: - """Sets the view to dashed hidden lines - - Returns: - None + """Sets the view to dashed hidden lines. """ def show_view_shaded2() -> None: - """Sets the view to shaded 2 - - Returns: - None + """Sets the view to shaded 2. """ def show_view_shaded1() -> None: - """Sets the view to shaded 1 - - Returns: - None + """Sets the view to shaded 1. """ -def is_selectable(element_id: int) -> bool: - """Returns if the element is selectable +def is_selectable(element_id: ElementId) -> bool: + """Returns if the element is selectable. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is selectable, false otherwise. """ -def set_unselectable(element_id_list: List[int]) -> None: - """Sets a list of elements unselectable +def set_unselectable(element_id_list: List[ElementId]) -> None: + """Sets a list of elements unselectable. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ -def set_selectable(element_id_list: List[int]) -> None: - """Sets a list of elements selectable +def set_selectable(element_id_list: List[ElementId]) -> None: + """Sets a list of elements selectable. Parameters: - element_id_list: element_id_list - - Returns: - None + element_id_list: The list of element id. """ def clear_errors() -> None: - """clear errors - - Returns: - None + """Clears all errors. """ def load_marking_settings(settings_file_path: str) -> None: - """Loads marking settings file + """Loads marking settings file. Parameters: - settings_file_path: settings_file_path - - Returns: - None + settings_file_path: The path to the settings file. """ def is_plane_2d() -> bool: - """returns if plane 2d is active + """returns if plane 2d is active. Returns: - bool + True if plane 2D is active, false otherwise. """ def set_camera(position: point_3d, target: point_3d) -> None: """Sets the position of the camera, pointing to a target. Parameters: - position: position - target: target - - Returns: - None + position: The position of the camera. + target: The target the camera is pointing at. """ def show_perspective_central() -> None: - """changes the viewmode to Perpective - - Returns: - None + """changes the viewmode to Perspective. """ -def set_color_without_material(elements: List[int], color_id: int) -> None: - """set color without material +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. Parameters: - elements: elements - color_id: color_id - - Returns: - None + element_id_list: A list of element id. + color_id: The color ID to set. """ -def set_texture_rotated(elements: List[int], flag: bool) -> None: - """set texture rotated +def set_texture_rotated(element_id_list: List[ElementId], flag: bool) -> None: + """Sets the rotation of the texture for a list of elements. Parameters: - elements: elements - flag: flag - - Returns: - None + element_id_list: A list of element id. + flag: True to rotate the texture, false to not rotate it. """ def show_reference_side_beam(show: bool) -> None: - """show reference side beam + """Shows or hides the reference side beam. Parameters: - show: show - - Returns: - None + show: True to show the reference side beam, false to hide it. """ def show_reference_side_panel(show: bool) -> None: - """show reference side panel + """Shows or hides the reference side panel. Parameters: - show: show - - Returns: - None + show: True to show the reference side panel, false to hide it. """ def show_reference_side_wall(show: bool) -> None: - """show reference side wall + """Shows or hides the reference side wall. Parameters: - show: show - - Returns: - None + show: True to show the reference side wall, false to hide it. """ def show_view_axo() -> None: - """changes the viewmode to Axo - - Returns: - None + """changes the viewmode to Axo. """ -def get_color(element_id: int) -> int: - """Gets the element color +def get_color(element_id: ElementId) -> int: + """Gets the element color. Parameters: - element_id: element_id + element_id: The element id. Returns: - color ID + The color ID of the element. """ -def get_opengl_color(element_id: int) -> 'rgb_color': - """Gets the element OpenGL color +def get_opengl_color(element_id: ElementId) -> rgb_color: + """Gets the element OpenGL color. Parameters: - element_id: element_id + element_id: The element id. Returns: - RBG color + The OpenGL color of the element. """ -def get_material(element_id: int) -> int: - """Gets the element material +def get_material(element_id: ElementId) -> MaterialId: + """Gets the element material. Parameters: - element_id: element_id + element_id: The element id. Returns: - material ID + The material id. """ -def get_rgb_from_cadwork_color_id(color_id: int) -> 'rgb_color': - """get rgb from cadwork color id +def get_rgb_from_cadwork_color_id(color_id: ColorId) -> rgb_color: + """Gets the RGB color from a Cadwork color ID. Parameters: - color_id: color_id + color_id: The Cadwork color ID. Returns: - colorRGB + The RGB color corresponding to the Cadwork color ID. """ -def is_texture_rotated(element_id: int) -> bool: - """is texture rotated +def is_texture_rotated(element_id: ElementId) -> bool: + """Checks if the texture of an element is rotated. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the texture is rotated, false otherwise. """ def get_camera_data() -> camera_data: - """Get the camera data + """Get the camera data. Returns: - 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 + """Set the camera data - this will override the current camera data. Parameters: - camera_data: camera_data - - Returns: - None + camera_data: The camera data to set. """ def is_cadwork_window_in_light_mode() -> bool: - """Check if Cadwork window is in light mode + """Check if Cadwork window is in light mode. Returns: - window is in light mode + True if the window is in light mode, false otherwise. """ def is_cadwork_window_in_dark_mode() -> bool: - """Check if Cadwork window is in dark mode + """Check if Cadwork window is in dark mode. Returns: - window is in dark mode + True if the window is in dark mode, false otherwise. """ def enter_working_plane(plane_normal: point_3d, plane_origin: point_3d) ->None: - """enter working plane + """Enter 2d working plane. Parameters: - plane_normal: plane_normal - plane_origin: plane_origin - - Returns: - None + plane_normal: A normalized plane vector. + plane_origin: A plane origin. """ -def get_element_transparency(element_id: int) ->int: - """get element transparency +def get_element_transparency(element_id: ElementId) ->int: + """Gets the element transparency. Parameters: - element_id: element_id + element_id: The element id. Returns: - int + Transparency value as percentage. """ -def set_element_transparency(element_id_list: List[int], value: int) -> None: - """set element transparency +def set_element_transparency(element_id_list: List[ElementId], value: int) -> None: + """Sets the element transparency. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: Transparency value as percentage. """ -def get_use_material_texture(element_id: int) -> bool: - """get use material texture +def get_use_material_texture(element_id: ElementId) -> bool: + """Check if element is using material texture. Parameters: - element_id: element_id + element_id: The element id. Returns: - bool + True if the element is using material texture, false otherwise. """ -def set_use_material_texture(element_id_list: List[int], value: bool) -> None: - """set use material texture +def set_use_material_texture(element_id_list: List[ElementId], value: bool) -> None: + """Sets element to use material texture. Parameters: - element_id_list: element_id_list - value: value - - Returns: - None + element_id_list: The element id list. + value: True to use material texture, false otherwise. """ def display_bitmaps_as_texture_representation_in_shaded1(flag: bool) -> None: - """display bitmaps as texture representation in shaded1 + """Set the graphic option to display bitmaps as textures in shaded 1. Parameters: - flag: flag - - Returns: - None + flag: True to display bitmaps as textures in shaded 1, false otherwise. """ def display_bitmaps_as_texture_representation_in_shaded2(flag: bool) -> None: - """display bitmaps as texture representation in shaded2 + """Set the graphic option to display bitmaps as textures in shaded 2. Parameters: - flag: flag - - Returns: - None - """ + flag: True to display bitmaps as textures in shaded 2, false otherwise. + """ \ No newline at end of file From bd0407db3b50463aab7e64dee8dac56433961f1a Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Mon, 25 Aug 2025 14:46:35 +0200 Subject: [PATCH 29/30] [API-519] Corrected some method signature to match the C++ ones --- src/connector_axis_controller/__init__.pyi | 3 +-- src/scene_controller/__init__.pyi | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/connector_axis_controller/__init__.pyi b/src/connector_axis_controller/__init__.pyi index ab614af..9208955 100644 --- a/src/connector_axis_controller/__init__.pyi +++ b/src/connector_axis_controller/__init__.pyi @@ -331,8 +331,7 @@ def get_standard_connector_list() -> List[str]: """ -def get_counterbore_diameter_for_start_side(axis_id: ElementId, section_index: UnsignedInt, diameter: float, depth: float, - is_conical: bool) -> float: +def get_counterbore_diameter_for_start_side(axis_id: ElementId, section_index: UnsignedInt) -> float: """Gets the counterbore diameter for the start side. Parameters: diff --git a/src/scene_controller/__init__.pyi b/src/scene_controller/__init__.pyi index 9f34ffd..9c48503 100644 --- a/src/scene_controller/__init__.pyi +++ b/src/scene_controller/__init__.pyi @@ -112,8 +112,7 @@ def is_scene_present(name: str) -> bool: True if the scene is present, false otherwise. """ -def set_group_tab_color(scene_group_name: str, red: int, green: int, blue: int) -> None: - # TODO : Missing alpha parameter +def set_group_tab_color(scene_group_name: str, red: int, green: int, blue: int, alpha: int) -> None: """Sets the group tab color. Parameters: From 5f48c16776a20e8b54d42e5849ac17227c77e89a Mon Sep 17 00:00:00 2001 From: BobillierCaddev Date: Wed, 3 Sep 2025 15:00:05 +0200 Subject: [PATCH 30/30] Corrected python version to 3.12 --- .github/workflows/test_publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index 13d941a..fb83b2d 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -18,10 +18,10 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.13' + python-version: '3.12' - run: pip install build - run: python -m build - uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - skip-existing: true \ No newline at end of file + skip-existing: true