Skip to content

Commit 9a844c7

Browse files
committed
Add display_attribute class and WebGL hierarchy function
Signed-off-by: Michael Brunner <brunner@cadwork.swiss>
1 parent b4436c4 commit 9a844c7

File tree

6 files changed

+150
-1
lines changed

6 files changed

+150
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# display_attribute
2+
3+
::: cadwork.display_attribute
4+
rendering:
5+
show_root_heading: false
6+
show_source: true

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ nav:
6565
- Hit Result: documentation/hit_result.md
6666
- Coordinate System Data: documentation/coordinate_system_data.md
6767
- Active Point Result: documentation/active_point_result.md
68+
- Display Attribute: documentation/display_attribute.md
6869
- Connector Axis Controller: documentation/connector_axis_controller.md
6970
- Dimension Controller: documentation/dimension_controller.md
7071
- Element Controller: documentation/element_controller.md

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cwapi3d"
3-
version = "32.443.1"
3+
version = "32.443.2"
44
authors = [{ name = "Cadwork", email = "it@cadwork.ca" }]
55
requires-python = ">= 3.12"
66
description = 'Python bindings for CwAPI3D'

src/cadwork/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ from .hit_result import hit_result
5252
from .dimension_base_format import dimension_base_format
5353
from .dxf_layer_format_type import dxf_layer_format_type
5454
from .dxf_export_version import dxf_export_version
55+
from .display_attribute import display_attribute
5556
from typing import List
5657

5758
# These assignments make each type accessible through both import styles:
@@ -114,6 +115,7 @@ dimension_base_format = dimension_base_format
114115
dxf_layer_format_type = dxf_layer_format_type
115116
dxf_export_version = dxf_export_version
116117
rgb_color = rgb_color
118+
display_attribute = display_attribute
117119

118120

119121
def get_auto_attribute_elements() -> List[int]:

src/cadwork/display_attribute.pyi

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
class display_attribute:
2+
"""
3+
A wrapper class for managing element display states.
4+
These methods update the internal state of the attribute
5+
object without requiring external parameters.
6+
"""
7+
8+
def __init__(self) -> None:
9+
"""Initializes a new display_attribute instance."""
10+
11+
def set_none(self) -> None:
12+
"""Resets or clears the current display attribute state.
13+
14+
Returns:
15+
None
16+
"""
17+
18+
def set_name(self) -> None:
19+
"""Triggers the assignment of the name attribute.
20+
21+
Returns:
22+
None
23+
"""
24+
25+
def set_group(self) -> None:
26+
"""Triggers the assignment of the group attribute.
27+
28+
Returns:
29+
None
30+
"""
31+
32+
def set_subgroup(self) -> None:
33+
"""Triggers the assignment of the subgroup attribute.
34+
35+
Returns:
36+
None
37+
"""
38+
39+
def set_comment(self) -> None:
40+
"""Triggers the assignment of the comment attribute.
41+
42+
Returns:
43+
None
44+
"""
45+
46+
def set_edv_code(self) -> None:
47+
"""Triggers the assignment of the EDV/ERP code.
48+
49+
Returns:
50+
None
51+
"""
52+
53+
def set_material(self) -> None:
54+
"""Triggers the assignment of the material attribute.
55+
56+
Returns:
57+
None
58+
"""
59+
60+
def set_material_group(self) -> None:
61+
"""Triggers the assignment of the material group attribute.
62+
63+
Returns:
64+
None
65+
"""
66+
67+
def set_user1(self) -> None:
68+
"""Triggers the assignment of custom user field 1."""
69+
70+
def set_user2(self) -> None:
71+
"""Triggers the assignment of custom user field 2."""
72+
73+
def set_user3(self) -> None:
74+
"""Triggers the assignment of custom user field 3."""
75+
76+
def set_user4(self) -> None:
77+
"""Triggers the assignment of custom user field 4."""
78+
79+
def set_user5(self) -> None:
80+
"""Triggers the assignment of custom user field 5."""
81+
82+
def set_user6(self) -> None:
83+
"""Triggers the assignment of custom user field 6."""
84+
85+
def set_user7(self) -> None:
86+
"""Triggers the assignment of custom user field 7."""
87+
88+
def set_user8(self) -> None:
89+
"""Triggers the assignment of custom user field 8."""
90+
91+
def set_user9(self) -> None:
92+
"""Triggers the assignment of custom user field 9."""
93+
94+
def set_user10(self) -> None:
95+
"""Triggers the assignment of custom user field 10."""
96+
97+
def set_production_number(self) -> None:
98+
"""Triggers the assignment of the production/fabrication number.
99+
100+
Returns:
101+
None
102+
"""
103+
104+
def set_timber_number(self) -> None:
105+
"""Triggers the assignment of the timber-specific member number.
106+
107+
Returns:
108+
None
109+
"""
110+
111+
def set_assembly_number(self) -> None:
112+
"""Triggers the assignment of the assembly/unit number.
113+
114+
Returns:
115+
None
116+
"""
117+
118+
def set_ifc_building(self) -> None:
119+
"""Triggers the assignment of the IFC building attribute.
120+
121+
Returns:
122+
None
123+
"""
124+
125+
def set_ifc_storey(self) -> None:
126+
"""Triggers the assignment of the IFC storey/level attribute.
127+
128+
Returns:
129+
None
130+
"""

src/file_controller/__init__.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ from cadwork.point_3d import point_3d
44
from cadwork.bim_team_upload_result import bim_team_upload_result
55
from cadwork.dxf_layer_format_type import dxf_layer_format_type
66
from cadwork.dxf_export_version import dxf_export_version
7+
from cadwork.display_attribute import display_attribute
78
from cadwork.api_types import *
89

910
def export_stl_file(element_id_list: List[ElementId], file_path: str) -> None:
@@ -584,3 +585,12 @@ def export_dstv_file(file_path: str) -> bool:
584585
Returns:
585586
True on successful export, false otherwise.
586587
"""
588+
589+
590+
def set_webgl_hierarchy(stage: int, attribute: display_attribute) -> None:
591+
"""Sets the WebGL hierarchy based on the given stage and attribute.
592+
593+
Parameters:
594+
stage: The hierarchy stage to set.
595+
attribute: The display attribute to use for the hierarchy.
596+
"""

0 commit comments

Comments
 (0)