Add support for FLOW_SEGMENT_U_SHAPE in the AddElement operator

This commit is contained in:
falken10vdl
2026-01-29 23:21:14 +01:00
parent 98a3b2b132
commit e47694458f
2 changed files with 20 additions and 0 deletions
@@ -206,6 +206,11 @@ class IfcClassData:
"Circular Hollow Distribution Segment",
"Works similarly to Profile, has distribution ports",
),
(
"FLOW_SEGMENT_U_SHAPE",
"U-Shape Distribution Segment",
"Uses IfcUShapeProfileDef, has distribution ports",
),
)
)
@@ -735,6 +735,21 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
Radius=(default_diameter / 2) / unit_scale,
WallThickness=default_thickness,
)
elif representation_template == "FLOW_SEGMENT_U_SHAPE":
default_depth = 0.4
default_flange_width = 0.2
default_web_thickness = 0.005
default_flange_thickness = 0.005
profile_name = f"{props.ifc_class}-{default_depth*1000}x{default_flange_width*1000}x{default_web_thickness*1000}x{default_flange_thickness*1000}"
profile = tool.Ifc.get().create_entity(
"IfcUShapeProfileDef",
ProfileName=profile_name,
ProfileType="AREA",
Depth=default_depth / unit_scale,
FlangeWidth=default_flange_width / unit_scale,
WebThickness=default_web_thickness / unit_scale,
FlangeThickness=default_flange_thickness / unit_scale,
)
rel = ifcopenshell.api.material.assign_material(
tool.Ifc.get(), products=[element], type="IfcMaterialProfileSet"