Skip to content

Commit 875bb61

Browse files
committed
Update type hints and improve documentation for IFC element types
Signed-off-by: Michael Brunner <brunner@cadwork.swiss>
1 parent 7c296c5 commit 875bb61

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/bim_controller/__init__.pyi

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from typing import List
22
from cadwork.ifc_2x3_element_type import ifc_2x3_element_type
33
from cadwork.ifc_options import ifc_options
44
from cadwork.ifc_predefined_type import ifc_predefined_type
5-
from cadwork.element_type import element_type
5+
66

77
def get_last_error(a0: int) -> str:
88
"""get last error
@@ -49,6 +49,11 @@ def set_ifc2x3_element_type(element_i_ds: List[int], ifc_type: ifc_2x3_element_t
4949
element_i_ds: element_i_ds
5050
ifc_type: element_type
5151
52+
Examples:
53+
>>> ifc_entity_type = cadwork.ifc_2x3_element_type()
54+
>>> ifc_entity_type.set_ifc_member()
55+
>>> bimc.set_ifc2x3_element_type([element], ifc_entity_type)
56+
5257
Returns:
5358
None
5459
"""
@@ -243,22 +248,22 @@ def get_storey_height(building: str, storey: str) -> float:
243248
"""
244249

245250

246-
def get_ifc2x3_element_type_string(element_type: element_type) -> str:
251+
def get_ifc2x3_element_type_string(entity_type: ifc_2x3_element_type) -> str:
247252
"""get ifc2x3 element type string
248253
249254
Parameters:
250-
element_type: element_type
255+
entity_type: entity_type
251256
252257
Returns:
253258
str
254259
"""
255260

256261

257-
def get_ifc2x3_element_type_display_string(element_type: element_type) -> str:
262+
def get_ifc2x3_element_type_display_string(entity_type: ifc_2x3_element_type) -> str:
258263
"""get ifc2x3 element type display string
259264
260265
Parameters:
261-
element_type: element_type
266+
entity_type: entity_type
262267
263268
Returns:
264269
str
@@ -312,7 +317,8 @@ def get_ifc_predefined_type(element_id: int) -> 'ifc_predefined_type':
312317
IfcPredefinedType Wrapper
313318
"""
314319

315-
def set_ifc_predefined_type(element_i_ds: List[int], predefined_type: None) -> None:
320+
321+
def set_ifc_predefined_type(element_i_ds: List[int], predefined_type: ifc_predefined_type) -> None:
316322
"""Set a predefined type to elements. Attention, if you change the PredefinedType of the elements, you are responsible for ensuring that valid types are set
317323
318324
Parameters:

0 commit comments

Comments
 (0)