mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +00:00
See #2981. Adding a door representation now also adds associated shape aspects
It doesn't add materials though, that's a separate responsibility right now
This commit is contained in:
@@ -44,6 +44,7 @@ try:
|
|||||||
from .add_representation import add_representation
|
from .add_representation import add_representation
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
print(f"Note: API not available due to missing dependencies: geometry.add_representation - {e}")
|
print(f"Note: API not available due to missing dependencies: geometry.add_representation - {e}")
|
||||||
|
from .add_shape_aspect import add_shape_aspect
|
||||||
from .add_slab_representation import add_slab_representation
|
from .add_slab_representation import add_slab_representation
|
||||||
from .add_wall_representation import add_wall_representation
|
from .add_wall_representation import add_wall_representation
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ __all__ = [
|
|||||||
"add_profile_representation",
|
"add_profile_representation",
|
||||||
"add_railing_representation",
|
"add_railing_representation",
|
||||||
"add_representation",
|
"add_representation",
|
||||||
|
"add_shape_aspect",
|
||||||
"add_slab_representation",
|
"add_slab_representation",
|
||||||
"add_wall_representation",
|
"add_wall_representation",
|
||||||
"add_window_representation",
|
"add_window_representation",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ def add_door_representation(
|
|||||||
operation_type: DOOR_TYPE = "SINGLE_SWING_LEFT",
|
operation_type: DOOR_TYPE = "SINGLE_SWING_LEFT",
|
||||||
lining_properties: Optional[Union[DoorLiningProperties, dict[str, Any]]] = None,
|
lining_properties: Optional[Union[DoorLiningProperties, dict[str, Any]]] = None,
|
||||||
panel_properties: Optional[Union[DoorPanelProperties, dict[str, Any]]] = None,
|
panel_properties: Optional[Union[DoorPanelProperties, dict[str, Any]]] = None,
|
||||||
|
part_of_product: Optional[ifcopenshell.entity_instance] = None,
|
||||||
unit_scale: Optional[float] = None,
|
unit_scale: Optional[float] = None,
|
||||||
) -> Union[ifcopenshell.entity_instance, None]:
|
) -> Union[ifcopenshell.entity_instance, None]:
|
||||||
"""Add a geometric representation for a door.
|
"""Add a geometric representation for a door.
|
||||||
@@ -272,6 +273,7 @@ def add_door_representation(
|
|||||||
"operation_type": operation_type,
|
"operation_type": operation_type,
|
||||||
"lining_properties": lining_properties,
|
"lining_properties": lining_properties,
|
||||||
"panel_properties": panel_properties,
|
"panel_properties": panel_properties,
|
||||||
|
"part_of_product": part_of_product,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
usecase.settings = settings
|
usecase.settings = settings
|
||||||
@@ -640,6 +642,29 @@ class Usecase:
|
|||||||
output_items = lining_offset_items + threshold_items + casing_items
|
output_items = lining_offset_items + threshold_items + casing_items
|
||||||
|
|
||||||
representation = builder.get_representation(self.settings["context"], output_items)
|
representation = builder.get_representation(self.settings["context"], output_items)
|
||||||
|
if self.settings["part_of_product"]:
|
||||||
|
ifcopenshell.api.geometry.add_shape_aspect(
|
||||||
|
self.file,
|
||||||
|
"Lining",
|
||||||
|
items=lining_items + window_lining_items + threshold_items + casing_items,
|
||||||
|
representation=representation,
|
||||||
|
part_of_product=self.settings["part_of_product"],
|
||||||
|
)
|
||||||
|
ifcopenshell.api.geometry.add_shape_aspect(
|
||||||
|
self.file,
|
||||||
|
"Framing",
|
||||||
|
items=door_items + frame_items,
|
||||||
|
representation=representation,
|
||||||
|
part_of_product=self.settings["part_of_product"],
|
||||||
|
)
|
||||||
|
if glass_items:
|
||||||
|
ifcopenshell.api.geometry.add_shape_aspect(
|
||||||
|
self.file,
|
||||||
|
"Glazing",
|
||||||
|
items=glass_items,
|
||||||
|
representation=representation,
|
||||||
|
part_of_product=self.settings["part_of_product"],
|
||||||
|
)
|
||||||
return representation
|
return representation
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
|||||||
Reference in New Issue
Block a user