Skip to content

Commit 966751a

Browse files
committed
Add support for FLOW_SEGMENT_RECTANGULAR_HOLLOW in profile creation in the MEP Segment Tool
1 parent ff35666 commit 966751a

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/bonsai/bonsai/bim/module/root/data.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ def representation_template(cls):
191191
"Rectangular Distribution Segment",
192192
"Works similarly to Profile, has distribution ports",
193193
),
194+
(
195+
"FLOW_SEGMENT_RECTANGULAR_HOLLOW",
196+
"Rectangular Hollow Distribution Segment",
197+
"Works similarly to Profile, has distribution ports",
198+
),
194199
(
195200
"FLOW_SEGMENT_CIRCULAR",
196201
"Circular Distribution Segment",

src/bonsai/bonsai/bim/module/root/operator.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,24 @@ def _execute(self, context):
697697
XDim=default_x_dim / unit_scale,
698698
YDim=default_y_dim / unit_scale,
699699
)
700+
elif representation_template == "FLOW_SEGMENT_RECTANGULAR_HOLLOW":
701+
default_x_dim = 0.4
702+
default_y_dim = 0.2
703+
default_thickness = 0.005
704+
default_inner_fillet_radius = 0.005
705+
default_outer_fillet_radius = 0.005
706+
profile_name = f"{props.ifc_class}-{default_x_dim*1000}x{default_y_dim*1000}"
707+
profile = tool.Ifc.get().create_entity(
708+
"IfcRectangleHollowProfileDef",
709+
ProfileName=profile_name,
710+
ProfileType="AREA",
711+
XDim=default_x_dim / unit_scale,
712+
YDim=default_y_dim / unit_scale,
713+
WallThickness=default_thickness / unit_scale,
714+
InnerFilletRadius=default_inner_fillet_radius / unit_scale,
715+
OuterFilletRadius=default_outer_fillet_radius / unit_scale,
716+
)
717+
700718
elif representation_template == "FLOW_SEGMENT_CIRCULAR":
701719
default_diameter = 0.1
702720
profile_name = f"{props.ifc_class}-{default_diameter*1000}"

0 commit comments

Comments
 (0)