mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Add support for FLOW_SEGMENT_U_SHAPE in the AddElement operator
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user