Skip to content
Merged
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
5 changes: 5 additions & 0 deletions docs/documentation/enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
show_root_heading: false
show_source: true

::: cadwork.panel_prefab_element_type
rendering:
show_root_heading: false
show_source: true

## IFC Aggregation Behaviour

::: cadwork.ifc_element_combine_behaviour
Expand Down
6 changes: 6 additions & 0 deletions docs/documentation/panel_prefab_element_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# panel_prefab_element_data

::: cadwork.panel_prefab_element_data
rendering:
show_root_heading: false
show_source: true
6 changes: 6 additions & 0 deletions docs/documentation/panel_prefab_element_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# panel_prefab_element_settings

::: cadwork.panel_prefab_element_settings
rendering:
show_root_heading: false
show_source: true
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ nav:
- Layer Settings: documentation/layer_settings.md
- Text Object Options: documentation/text_object_options.md
- Import 3DC Options: documentation/import_3dc_options.md
- Panel Prefab Element Data: documentation/panel_prefab_element_data.md
- Panel Prefab Element Settings: documentation/panel_prefab_element_settings.md
- Window Geometry: documentation/window_geometry.md
- BIMteam Upload Result: documentation/bim_team_upload_result.md
- Shoulder cut options: documentation/shoulder_options.md
Expand Down
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.265.2"
version = "33.293.0"
authors = [{ name = "Cadwork", email = "it@cadwork.ca" }]
requires-python = ">= 3.14"
description = 'Python bindings for CwAPI3D'
Expand Down
6 changes: 6 additions & 0 deletions src/cadwork/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ from .ifc_options_project_data import ifc_options_project_data as ifc_options_pr
from .ifc_options_properties import ifc_options_properties as ifc_options_properties
from .import_3dc_options import import_3dc_options as import_3dc_options
from .layer_settings import layer_settings as layer_settings
from .panel_prefab_element_data import panel_prefab_element_data as panel_prefab_element_data
from .panel_prefab_element_settings import panel_prefab_element_settings as panel_prefab_element_settings
from .point import point as point
from .point_3d import point_3d as point_3d
from .polygon_list import polygon_list as polygon_list
Expand Down Expand Up @@ -76,6 +78,7 @@ from .multi_layer_cover_type import multi_layer_cover_type as multi_layer_cover_
from .multi_layer_subtype import multi_layer_subtype as multi_layer_subtype
from .multi_layer_type import multi_layer_type as multi_layer_type
from .node_symbol import node_symbol as node_symbol
from .panel_prefab_element_type import panel_prefab_element_type as panel_prefab_element_type
from .process_type import process_type as process_type
from .projection_type import projection_type as projection_type
from .shortcut_key import shortcut_key as shortcut_key
Expand Down Expand Up @@ -124,6 +127,8 @@ __all__ = [
"ifc_options_properties",
"import_3dc_options",
"layer_settings",
"panel_prefab_element_data",
"panel_prefab_element_settings",
"point",
"point_3d",
"polygon_list",
Expand Down Expand Up @@ -152,6 +157,7 @@ __all__ = [
"multi_layer_subtype",
"multi_layer_type",
"node_symbol",
"panel_prefab_element_type",
"process_type",
"projection_type",
"shortcut_key",
Expand Down
44 changes: 44 additions & 0 deletions src/cadwork/panel_prefab_element_data.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from cadwork.panel_prefab_element_type import panel_prefab_element_type


class panel_prefab_element_data:
"""Read-only machine panel prefabrication data of an element.

Holds the element type, layer location and MFB prefab config (machine
calculation set) of an element. Returned by
machine_controller.get_panel_prefab_element_data.
"""

def get_element_type(self) -> panel_prefab_element_type:
"""get element type

Returns:
panel_prefab_element_type
"""

def has_layer(self) -> bool:
"""has layer

Tests if a layer location is set on the element.

Returns:
bool
"""

def get_layer(self) -> int:
"""get layer

Gets the layer location. Only meaningful if has_layer() returns True.

Returns:
int
"""

def get_machine_calculation_set(self) -> str:
"""get machine calculation set

Gets the machine calculation set (MFB prefab config) name.

Returns:
str
"""
58 changes: 58 additions & 0 deletions src/cadwork/panel_prefab_element_settings.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from cadwork.panel_prefab_element_type import panel_prefab_element_type


class panel_prefab_element_settings:
"""Machine panel prefabrication settings passed to the setter.

Only the fields that are explicitly set are applied to the elements; unset
fields are left untouched, mirroring the interactive "only change what
differs" behaviour. Passed to machine_controller.set_panel_prefab_element_data.
"""

def __init__(self) -> None:
"""Creates an empty panel prefab element settings object."""

def set_element_type(self, type: panel_prefab_element_type) -> None:
"""set element type

Sets the panel prefab element type to apply.

Parameters:
type: The element type.

Returns:
None
"""

def set_layer(self, layer: int) -> None:
"""set layer

Sets the layer location to apply.

Parameters:
layer: The layer location.

Returns:
None
"""

def reset_layer(self) -> None:
"""reset layer

Resets (clears) the layer location.

Returns:
None
"""

def set_machine_calculation_set(self, machine_calculation_set: str) -> None:
"""set machine calculation set

Sets the machine calculation set (MFB prefab config) name to apply.

Parameters:
machine_calculation_set: The MFB prefab config name.

Returns:
None
"""
30 changes: 30 additions & 0 deletions src/cadwork/panel_prefab_element_type.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from enum import IntEnum, unique


@unique
class panel_prefab_element_type(IntEnum):
"""panel prefab element type

Exclusive machine panel prefabrication element type of an element.

Examples:
>>> cadwork.panel_prefab_element_type.batten
batten
"""
none = 0
""""""
frame = 1
""""""
panel = 2
""""""
batten = 3
""""""
cladding = 4
""""""
insulation = 5
""""""
built_in_part = 6
""""""

def __int__(self) -> int:
return self.value
52 changes: 52 additions & 0 deletions src/machine_controller/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ 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.panel_prefab_element_data import panel_prefab_element_data
from cadwork.panel_prefab_element_settings import panel_prefab_element_settings
from cadwork.weinmann_mfb_version import weinmann_mfb_version


Expand Down Expand Up @@ -315,4 +317,54 @@ def get_processing_btl_parameter_set(reference_element_id: ElementId, processing

Returns:
A list of strings representing the BTL parameter set of the processing.
"""


def get_panel_prefab_element_data(element_id: ElementId) -> panel_prefab_element_data:
"""Gets the machine panel prefabrication data of an element.

Returns the element type, layer location and MFB prefab config
(machine calculation set) of an element.

Parameters:
element_id: The element id.

Examples:
>>> import cadwork
>>> import machine_controller as mc

>>> element: int = 123456789
>>> data = mc.get_panel_prefab_element_data(element)
>>> element_type = data.get_element_type()
>>> if data.has_layer():
>>> layer = data.get_layer()
>>> config = data.get_machine_calculation_set()

Returns:
The panel prefab element data.
"""


def set_panel_prefab_element_data(element_id_list: list[ElementId], settings: panel_prefab_element_settings) -> None:
"""Sets the machine panel prefabrication data on a list of elements.

Only the fields explicitly set on the settings object are applied; unset
fields are left untouched. Elements without a panel prefabrication
interface are skipped.

Parameters:
element_id_list: The list of element ids.
settings: The panel prefab settings to apply.

Examples:
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc

>>> elements = ec.get_active_identifiable_element_ids()
>>> settings = cadwork.panel_prefab_element_settings()
>>> settings.set_element_type(cadwork.panel_prefab_element_type.batten)
>>> settings.set_layer(2)
>>> settings.set_machine_calculation_set("MyMfbConfig")
>>> mc.set_panel_prefab_element_data(elements, settings)
"""
Loading