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

Filter by extension

Filter by extension


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

## End Type

::: cadwork.end_type
rendering:
show_root_heading: false
show_source: true
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cwapi3d"
version = "33.328.0"
version = "33.330.0"

authors = [{ name = "Cadwork", email = "it@cadwork.ca" }]
requires-python = ">= 3.14"
Expand Down
2 changes: 2 additions & 0 deletions src/cadwork/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ from .dxf_export_version import dxf_export_version as dxf_export_version
from .dxf_layer_format_type import dxf_layer_format_type as dxf_layer_format_type
from .element_grouping_type import element_grouping_type as element_grouping_type
from .element_type import element_type as element_type
from .end_type import end_type as end_type
from .hundegger_machine_type import hundegger_machine_type as hundegger_machine_type
from .ifc_2x3_element_type import ifc_2x3_element_type as ifc_2x3_element_type
from .ifc_element_combine_behaviour import ifc_element_combine_behaviour as ifc_element_combine_behaviour
Expand Down Expand Up @@ -152,6 +153,7 @@ __all__ = [
"dxf_layer_format_type",
"element_grouping_type",
"element_type",
"end_type",
"hundegger_machine_type",
"ifc_2x3_element_type",
"ifc_element_combine_behaviour",
Expand Down
33 changes: 33 additions & 0 deletions src/cadwork/end_type.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from enum import IntEnum, unique


@unique
class end_type(IntEnum):
"""end type

End type of an element.

Examples:
>>> cadwork.end_type.Tenon
Tenon
"""

Unknown = 0
""""""
Tenon = 1
""""""
Lengthening = 2
""""""
DovetailTenon = 3
""""""
GMIWithCounterpart = 4
""""""
DovetailMortise = 5
""""""
FrontSlot = 6
""""""
JapaneseTenon = 7
""""""

def __int__(self) -> int:
return self.value
48 changes: 24 additions & 24 deletions src/endtype_controller/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_endtype_id_start(element_id: ElementId) -> EndtypeId:
"""Gets the endtype id of the start face.

Parameters:
element_id: The element id.
element_id: The cadwork element id.

Examples:
>>> import element_controller as ec
Expand All @@ -42,14 +42,14 @@ def get_endtype_id_start(element_id: ElementId) -> EndtypeId:
>>> print(f"Start endtype ID: {start_endtype_id}")

Returns:
The wanted endtype id.
The wanted endtype element id.
"""

def get_endtype_id_end(element_id: ElementId) -> EndtypeId:
"""Gets the endtype id of the end face.

Parameters:
element_id: The element id.
element_id: The cadwork element id.

Examples:
>>> import element_controller as ec
Expand All @@ -61,15 +61,15 @@ def get_endtype_id_end(element_id: ElementId) -> EndtypeId:
>>> print(f"End endtype ID: {end_endtype_id}")

Returns:
The wanted endtype id.
The wanted endtype element id.
"""


def get_endtype_id_facet(element_id: ElementId, face_number: int) -> EndtypeId:
"""Gets the endtype id of a face with the face number.

Parameters:
element_id: The element id.
element_id: The cadwork element id.
face_number: The face number. 0 <= aFaceNumber < element face count.

Note:
Expand All @@ -87,14 +87,14 @@ def get_endtype_id_facet(element_id: ElementId, face_number: int) -> EndtypeId:
>>> print(f"Facet endtype ID: {facet_endtype_id}")

Returns:
The wanted endtype id.
The wanted endtype element id.
"""

def set_endtype_name_start(element_id: ElementId, name: str) -> None:
"""Sets the endtype to start face by endtype name.

Parameters:
element_id: The element id.
element_id: The cadwork element id.
name: The endtype name.

Examples:
Expand All @@ -111,7 +111,7 @@ def set_endtype_name_end(element_id: ElementId, name: str) -> None:
"""Sets the endtype to end face by endtype name.

Parameters:
element_id: The element id.
element_id: The cadwork element id.
name: The endtype name.

Examples:
Expand All @@ -129,7 +129,7 @@ def set_endtype_name_facet(element_id: ElementId, name: str, face_number: int) -
"""Sets the endtype to a face by endtype name.

Parameters:
element_id: The element id.
element_id: The cadwork element id.
name: The endtype name.
face_number: The face number. 0 <= aFaceNumber < element face count.

Expand All @@ -152,8 +152,8 @@ def set_endtype_id_start(element_id: ElementId, endtype_id: EndtypeId) -> None:
"""Sets the endtype to start face by endtype id.

Parameters:
element_id: The element id.
endtype_id: The endtype id.
element_id: The cadwork element id.
endtype_id: The endtype element id.

Examples:
>>> import element_controller as ec
Expand All @@ -169,8 +169,8 @@ def set_endtype_id_end(element_id: ElementId, endtype_id: EndtypeId) -> None:
"""Sets the endtype to end face by endtype id.

Parameters:
element_id: The element id.
endtype_id: The endtype id.
element_id: The cadwork element id.
endtype_id: The endtype element id.

Examples:
>>> import element_controller as ec
Expand All @@ -187,8 +187,8 @@ def set_endtype_id_facet(element_id: ElementId, endtype_id: EndtypeId, face_numb
"""Sets the endtype to a face by endtype id.

Parameters:
element_id: The element id.
endtype_id: The endtype id.
element_id: The cadwork element id.
endtype_id: The endtype element id.
face_number: The face number. 0 <= aFaceNumber < element face count.

Note:
Expand All @@ -206,32 +206,32 @@ def set_endtype_id_facet(element_id: ElementId, endtype_id: EndtypeId, face_numb
>>> etc.set_endtype_id_facet(element, endtype_id, face_number)
"""

def create_new_endtype(endtype_name: str, endtype_id: EndtypeId, folder_name: str) -> EndtypeId:
def create_new_endtype(endtype_name: str, end_type_id: int, folder_name: str) -> EndtypeId:
"""Creates a new Endtype.

Parameters:
endtype_name: The new endtype name.
endtype_id: The new endtype id.
end_type_id: The type of end you want to create. Use [cadwork.end_type][cadwork.end_type] enum.
folder_name: The new endtype folder.

Examples:
>>> import endtype_controller as etc

>>> endtype_name = "Custom_Joint_80x40"
>>> endtype_id = 99999
>>> end_type_id = cadwork.end_type.Tenon
>>> folder_name = "Custom_Joints"
>>> new_id = etc.create_new_endtype(endtype_name, endtype_id, folder_name)
>>> new_id = etc.create_new_endtype(endtype_name, end_type_id, folder_name)
>>> print(f"Created endtype with ID: {new_id}")

Returns:
The ID of the created endtype.
The ID of the created endtype. Or 0 if error.
"""

def get_endtype_name(element_id: ElementId) -> str:
"""Gets the endtype name by endtype id.

Parameters:
element_id: The endtype id.
element_id: The endtype element id.

Examples:
>>> import endtype_controller as etc
Expand All @@ -248,7 +248,7 @@ def get_endtype_name_start(element_id: ElementId) -> str:
"""Gets the endtype name of the start face.

Parameters:
element_id: The element id.
element_id: The cadwork element id.

Examples:
>>> import element_controller as ec
Expand All @@ -267,7 +267,7 @@ def get_endtype_name_end(element_id: ElementId) -> str:
"""Gets the endtype name of the end face.

Parameters:
element_id: The element id.
element_id: The cadwork element id.

Examples:
>>> import element_controller as ec
Expand All @@ -286,7 +286,7 @@ 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: The element id.
element_id: The cadwork element id.
face_number: The face number. 0 <= aFaceNumber < element face count.

Note:
Expand Down
Loading