From 422ffe02f93455447ef42839d6d005cc13ee2a3f Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Mon, 20 Jul 2026 14:06:48 +0200 Subject: [PATCH 1/2] [API-626] Added create rotation element and export as standard element method --- src/element_controller/__init__.pyi | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/element_controller/__init__.pyi b/src/element_controller/__init__.pyi index 4ae176b..6dd6a15 100644 --- a/src/element_controller/__init__.pyi +++ b/src/element_controller/__init__.pyi @@ -2348,4 +2348,53 @@ def import_standard_panel_from_file(file_path: str) -> None: Parameters: file_path: The path to the file to be imported. + """ + + +def export_as_standard_element(element_id: ElementId, name: str) -> str: + """Exports an existing element as a standard element. + + In case of duplicated names, a count suffix will be appended (e.g., (2)). + Note that creating elements of standard element type Metal is not supported by this function. + + Parameters: + element_id: The element to export as a standard element. + name: The name of the standard element. + + Returns: + The GUID of the new standard element on success, an empty string on error. + """ + + +def create_rotation_element(surface_element_id: ElementId, axis_point: point_3d, axis_direction: point_3d, angle_rad: float, segmentation: int) -> ElementId: + """Creates a rotation element from a surface element by rotating it around an axis. + + Parameters: + surface_element_id: The ID of the source surface element to rotate. The element must be a surface. + axis_point: A point on the rotation axis. + axis_direction: The direction vector of the rotation axis. + angle_rad: The rotation angle in radians. + segmentation: Number of division steps used to tessellate the generated rotation element. (0 for smooth ACIS solid, >0 for faceted) + + Examples: + >>> import math + >>> # Create a rectangular surface and rotate it 360° around an axis to form a cylinder + >>> radius = 200.0 + >>> height = 1000.0 + >>> # Define a rectangular surface profile in the XZ plane + >>> vertices = cadwork.vertex_list() + >>> vertices.append(cadwork.point_3d(0.0, 0.0, 0.0)) + >>> vertices.append(cadwork.point_3d(0.0, 0.0, height)) + >>> vertices.append(cadwork.point_3d(radius, 0.0, height)) + >>> vertices.append(cadwork.point_3d(radius, 0.0, 0.0)) + >>> surface_id = ec.create_surface(vertices) + >>> # Rotate the surface 360° around the Z axis to create a cylinder + >>> axis_point = cadwork.point_3d(0.0, 0.0, 0.0) + >>> axis_direction = cadwork.point_3d(0.0, 0.0, 1.0) + >>> full_rotation = 2.0 * math.pi # 360 degrees + >>> discretization_steps = 0 # automatic + >>> cylinder_id = ec.create_rotation_element(surface_id, axis_point, axis_direction, full_rotation, discretization_steps) + + Returns: + The ID of the created rotation element. """ \ No newline at end of file From f24df3c032e42a5431c084859d57b9b30154736c Mon Sep 17 00:00:00 2001 From: Laura Bobillier Date: Mon, 20 Jul 2026 14:07:08 +0200 Subject: [PATCH 2/2] [API-626] updated doc version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a07ca45..8c8723a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cwapi3d" -version = "33.307.0" +version = "33.318.0" authors = [{ name = "Cadwork", email = "it@cadwork.ca" }] requires-python = ">= 3.14" description = 'Python bindings for CwAPI3D'