diff --git a/docs/documentation/enums.md b/docs/documentation/enums.md index ddb5fc7..9e495cc 100644 --- a/docs/documentation/enums.md +++ b/docs/documentation/enums.md @@ -127,3 +127,7 @@ rendering: show_root_heading: false show_source: true + +## working_plane_exit_view + +::: cadwork.working_plane_exit_view diff --git a/pyproject.toml b/pyproject.toml index e3e10c6..87855f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cwapi3d" -version = "33.328.0" +version = "33.330.0" authors = [{ name = "Cadwork", email = "it@cadwork.ca" }] requires-python = ">= 3.14" diff --git a/src/bim_controller/__init__.pyi b/src/bim_controller/__init__.pyi index 3e5631d..8f1c556 100644 --- a/src/bim_controller/__init__.pyi +++ b/src/bim_controller/__init__.pyi @@ -483,3 +483,25 @@ def get_elements_for_storey(building: str, storey: str) -> list[ElementId]: Returns: The list of element ids assigned to the storey. """ + +def export_ifc4(element_id_list: list[ElementId], file_path: str) -> bool: + """Exports an IFC 4 file. + + Parameters: + element_id_list: A list of element ids to be included in the export. + file_path: The path where the IFC file will be exported. + + Returns: + True if the export was successful, false otherwise. + """ + +def export_ifc2x3(element_id_list: list[ElementId], file_path: str) -> bool: + """Exports an IFC 2x3. + + Parameters: + element_id_list: A list of element ids to be included in the export. + file_path: The path where the IFC file will be exported. + + Returns: + True if the export was successful, false otherwise. + """ diff --git a/src/cadwork/__init__.pyi b/src/cadwork/__init__.pyi index 798f824..637c96a 100644 --- a/src/cadwork/__init__.pyi +++ b/src/cadwork/__init__.pyi @@ -90,6 +90,7 @@ from .standard_element_type import standard_element_type as standard_element_typ from .text_element_type import text_element_type as text_element_type from .vba_catalog_item_type import vba_catalog_item_type as vba_catalog_item_type from .weinmann_mfb_version import weinmann_mfb_version as weinmann_mfb_version +from .working_plane_exit_view import working_plane_exit_view as working_plane_exit_view __all__ = [ # Type aliases @@ -171,6 +172,7 @@ __all__ = [ "text_element_type", "vba_catalog_item_type", "weinmann_mfb_version", + "working_plane_exit_view", # Module-level functions "get_auto_attribute_elements", "set_auto_attribute", diff --git a/src/cadwork/working_plane_exit_view.pyi b/src/cadwork/working_plane_exit_view.pyi new file mode 100644 index 0000000..aed102b --- /dev/null +++ b/src/cadwork/working_plane_exit_view.pyi @@ -0,0 +1,26 @@ +from enum import IntEnum, unique + + +@unique +class working_plane_exit_view(IntEnum): + """working plane exit view + + Examples: + >>> cadwork.working_plane_exit_view.previous_view + previous_view + """ + previous_view = 0 + """Restores the view and controller active before entering.""" + standard_axonometry = 1 + """Standard axonometry.""" + view_positive_x = 2 + """Same view as showViewPositiveX(). GUI label "X".""" + view_positive_y = 3 + """Same view as showViewPositiveY(). GUI label "-Y".""" + view_positive_z = 4 + """Same view as showViewPositiveZ(). GUI label "Z".""" + keep_current_camera = 5 + """Keeps the current camera, in 3d. GUI label "Axo same view".""" + + def __int__(self) -> int: + return self.value diff --git a/src/element_controller/__init__.pyi b/src/element_controller/__init__.pyi index f84ac66..503c152 100644 --- a/src/element_controller/__init__.pyi +++ b/src/element_controller/__init__.pyi @@ -2457,4 +2457,20 @@ def create_rotation_element(surface_element_id: ElementId, axis_point: point_3d, Returns: The ID of the created rotation element. - """ \ No newline at end of file + """ + +def apply_image_to_surface(element: ElementId, image_file_path: str, alignment_start: point_3d, alignment_end: point_3d) -> bool: + """Applies an image texture to a specified surface element. This function allows you to set an image as a texture on a given surface element. The image is mapped to the surface between two specified points that define the alignment and scaling. + + Parameters: + element: Surface element + image_file_path: The file path to the image to be applied. Supported formats include `.jpg`, `.png`, `.bmp`, and `.tif`. Path example: `LR"(C:/path/to/Image.png)"`. + alignment_start: The starting alignment point for mapping the image on the surface. + alignment_end: The ending alignment point for mapping the image on the surface. + + Note: + Ensure that the file path is valid and accessible, and that the surface element exists Proper error handling for invalid inputs is recommended. + + Returns: + Returns `true` if the image was successfully applied to the surface; otherwise, returns `false` in case of failure. Failures can occur due to invalid file paths, unsupported formats, or issues with the surface element. + """ diff --git a/src/file_controller/__init__.pyi b/src/file_controller/__init__.pyi index 9069e23..423a4d5 100644 --- a/src/file_controller/__init__.pyi +++ b/src/file_controller/__init__.pyi @@ -602,3 +602,14 @@ def set_webgl_hierarchy(stage: int, attribute: display_attribute) -> None: stage: The hierarchy stage to set. attribute: The display attribute to use for the hierarchy. """ + + +def export_step_file_ex(element_list: list[ElementId], file_path: str, scale_factor: float, substract_drillings: bool) -> None: + """Exports a STEP file with new algorithm. + + Parameters: + element_list: The list of element id to export. + file_path: The output file path. + scale_factor: The file scale factor. + substract_drillings: Substract drillings. + """ diff --git a/src/geometry_controller/__init__.pyi b/src/geometry_controller/__init__.pyi index 83a446e..9efd7de 100644 --- a/src/geometry_controller/__init__.pyi +++ b/src/geometry_controller/__init__.pyi @@ -11,6 +11,7 @@ to create or destroy it. from cadwork.api_types import ElementId, UnsignedInt from cadwork.facet_list import facet_list from cadwork.point_3d import point_3d +from cadwork.division_zone_direction import division_zone_direction def rotate_height_axis_90(element_id_list: list[ElementId]) -> None: @@ -931,3 +932,41 @@ def get_length_including_end_types(element_id: ElementId) -> float: Returns: The element length including end-types. """ + +def create_division_zone(element_id: ElementId, point: point_3d, direction: division_zone_direction) -> None: + """Creates a division zone. + + Parameters: + element_id: The element Id. + point: The division zone point. + direction: The division zone direction. + """ + +def delete_division_zone(element_id: ElementId) -> None: + """Deletes a division zone. + + Parameters: + element_id: The element Id. + """ + +def get_division_zone_points(element_id: ElementId) -> list[point_3d]: + """Gets the division zone points. + + Parameters: + element_id: The element Id. + + Returns: + The division zone points. + """ + +def stretch_facet(element_id: ElementId, facet_index: UnsignedInt, distance: float) -> bool: + """Moves one facet of an element along its own plane normal, growing or shrinking the body at that face. + + Parameters: + element_id: The element to modify. + facet_index: Index into the element's facet list in the same order getElementFacets An element with no facets fails. The index is only valid against a facet table read from the element in its CURRENT state: a successful stretch renumbers the list, because the geometry kernel rebuilds the body's face order after every local operation. To move several facets of one element, re-read getElementFacets after each call and re-locate the next facet by its normal - carrying indices 0..count-1 across a loop will address the same facet twice and miss others. + distance: Signed travel in model units (mm) along the normal getElementFacets reports for this facet index: positive grows the body at that face, negative shrinks it, zero is a successful no-op that leaves the geometry untouched. + + Returns: + Whether the facet was moved. - true: the facet moved (or the distance was zero) and the element is marked modified - false: nothing was modified — a distinct code and message are on the error stack, readable via getLastError, and logged to the cadwork API log + """ diff --git a/src/list_controller/__init__.pyi b/src/list_controller/__init__.pyi index 4822982..c23c01a 100644 --- a/src/list_controller/__init__.pyi +++ b/src/list_controller/__init__.pyi @@ -127,3 +127,11 @@ def export_cover_list_with_settings(element_id_list: list[ElementId], file_path: 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_container_list(element_id_list: list[ElementId], export_file_path: str) -> None: + """Exports a container list. + + Parameters: + element_id_list: The element list id. + export_file_path: The exported file path. + """ diff --git a/src/multi_layer_cover_controller/__init__.pyi b/src/multi_layer_cover_controller/__init__.pyi index 012e8cf..d790ef0 100644 --- a/src/multi_layer_cover_controller/__init__.pyi +++ b/src/multi_layer_cover_controller/__init__.pyi @@ -602,4 +602,94 @@ def create_multi_layer_solid_wall(set_name: str) -> MultiLayerSetId: Returns: The multi layer set id. - """ \ No newline at end of file + """ + +def get_multi_layer_set_component_type(set_id: MultiLayerSetId) -> int: + """Gets the multi layer set component type. + + Parameters: + set_id: The multi layer set id. + + Returns: + The multi layer set component type. + """ + +def set_multi_layer_set_component_type(set_id: MultiLayerSetId, type: int) -> None: + """Sets the multi layer set component type. + + Parameters: + set_id: The multi layer set id. + type: The multi layer set component type. + """ + +def get_layer_sub_type(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> int: + """Gets the layer sub type. + + Parameters: + set_id: The multi layer set id. + layer_index: The layer index. + + Returns: + The layer sub type. + """ + +def set_layer_sub_type(set_id: MultiLayerSetId, layer_index: UnsignedInt, sub_type: int) -> None: + """Sets the layer sub type. + + Parameters: + set_id: The multi layer set id. + layer_index: The layer index. + sub_type: The layer sub type. + """ + +def get_layer_standard_panel_guid(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> str: + """Gets the layer standard panel guid. + + Parameters: + set_id: The multi layer set id. + layer_index: The layer index. + + Returns: + The layer standard panel guid. + """ + +def set_layer_standard_panel_guid(set_id: MultiLayerSetId, layer_index: UnsignedInt, guid: str) -> None: + """Sets the layer standard panel guid. + + Parameters: + set_id: The multi layer set id. + layer_index: The layer index. + guid: The layer standard panel guid. + """ + +def get_layer_standard_beam_guid(set_id: MultiLayerSetId, layer_index: UnsignedInt) -> str: + """Gets the layer standard beam guid. + + Parameters: + set_id: The multi layer set id. + layer_index: The layer index. + + Returns: + The layer standard beam guid. + """ + +def set_layer_standard_beam_guid(set_id: MultiLayerSetId, layer_index: UnsignedInt, guid: str) -> None: + """Sets the layer standard beam guid. + + Parameters: + set_id: The multi layer set id. + layer_index: The layer index. + guid: The layer standard beam guid. + """ + +def add_layer_by_standard_elements(set_id: MultiLayerSetId, type: multi_layer_type, name: str, panel_guid: str, beam_guid: str, thickness: float) -> None: + """Adds layer by standard element. + + Parameters: + set_id: The multi layer set id. + type: The multi layer set component type. + name: The layer name. + panel_guid: The layer standard panel guid. + beam_guid: The layer standard beam guid. + thickness: The layer thickness. + """ diff --git a/src/visualization_controller/__init__.pyi b/src/visualization_controller/__init__.pyi index 46b9ad7..6563988 100644 --- a/src/visualization_controller/__init__.pyi +++ b/src/visualization_controller/__init__.pyi @@ -11,6 +11,7 @@ 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 +from cadwork.working_plane_exit_view import working_plane_exit_view def set_color(element_id_list: list[ElementId], color_id: ColorId) -> None: """Sets the element color. @@ -441,4 +442,45 @@ def display_bitmaps_as_texture_representation_in_shaded2(flag: bool) -> None: Parameters: flag: True to display bitmaps as textures in shaded 2, false otherwise. - """ \ No newline at end of file + """ + +def leave_working_plane(exit_view: working_plane_exit_view) -> None: + """Leaves the 2d working plane and restores a 3d view. Does nothing when the 2d working plane is not currently active. + + Parameters: + exit_view: The 3d view to restore on leaving. + + Note: + When the working plane was entered from inside a container block, only workingPlaneExitView::previous_view returns into that container block; every other value leaves it and switches to the plain 3d model view. + """ + +def is_permanently_hidden(element_id: ElementId) -> bool: + """Tests whether an element is permanently hidden. + + Parameters: + element_id: The element id. + + Returns: + True if the element is permanently hidden, false otherwise, and false when the id does not resolve to an element. + """ + +def hide_permanently(element_id_list: list[ElementId]) -> None: + """Takes elements out of the model's working set and keeps them there. + + Parameters: + element_id_list: The elements to hide permanently. + """ + +def show_permanently_hidden(element_id_list: list[ElementId]) -> None: + """Brings elements this API hid permanently back into the working set. + + Parameters: + element_id_list: The elements to show again. + """ + +def get_permanently_hidden_elements() -> list[ElementId]: + """Gets the elements this API hid permanently and has not shown again. + + Returns: + The permanently hidden elements owned by this API, empty when there are none. + """