Skip to content

Commit 4dc55e8

Browse files
committed
Fix default mep profile names
Previously it was generating names like 4000000x4000000 in mm projects.
1 parent b611151 commit 4dc55e8

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

src/blenderbim/blenderbim/bim/module/type/operator.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,32 +312,36 @@ def _execute(self, context):
312312
)
313313
else:
314314
# NOTE: defaults dims are in meters / mm
315+
# for now default names are hardcoded to mm
315316
if template == "FLOW_SEGMENT_RECTANGULAR":
316-
default_x_dim = 0.4 / unit_scale
317-
default_y_dim = 0.2 / unit_scale
318-
profile_name = f"{ifc_class}-{default_x_dim*1000}x{default_x_dim*1000}"
317+
default_x_dim = 0.4
318+
default_y_dim = 0.2
319+
profile_name = f"{ifc_class}-{default_x_dim*1000}x{default_y_dim*1000}"
319320
profile = ifc_file.create_entity(
320321
"IfcRectangleProfileDef",
321322
ProfileName=profile_name,
322323
ProfileType="AREA",
323-
XDim=default_x_dim,
324-
YDim=default_y_dim,
324+
XDim=default_x_dim / unit_scale,
325+
YDim=default_y_dim / unit_scale,
325326
)
326327
elif template == "FLOW_SEGMENT_CIRCULAR":
327-
default_diameter = 0.1 / unit_scale
328+
default_diameter = 0.1
328329
profile_name = f"{ifc_class}-{default_diameter*1000}"
329330
profile = ifc_file.create_entity(
330-
"IfcCircleProfileDef", ProfileName=profile_name, ProfileType="AREA", Radius=default_diameter / 2
331+
"IfcCircleProfileDef",
332+
ProfileName=profile_name,
333+
ProfileType="AREA",
334+
Radius=(default_diameter / 2) / unit_scale,
331335
)
332336
elif template == "FLOW_SEGMENT_CIRCULAR_HOLLOW":
333-
default_diameter = 0.15 / unit_scale
334-
default_thickness = 0.005 / unit_scale
337+
default_diameter = 0.15
338+
default_thickness = 0.005
335339
profile_name = f"{ifc_class}-{default_diameter*1000}x{default_thickness*1000}"
336340
profile = ifc_file.create_entity(
337341
"IfcCircleHollowProfileDef",
338342
ProfileName=profile_name,
339343
ProfileType="AREA",
340-
Radius=default_diameter / 2,
344+
Radius=(default_diameter / 2) / unit_scale,
341345
WallThickness=default_thickness,
342346
)
343347

0 commit comments

Comments
 (0)