mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fix #6131. Fix bug where you could potentially create an invalid composite profile with no profiles.
This commit is contained in:
@@ -288,7 +288,7 @@ class EditArbitraryProfile(bpy.types.Operator, tool.Ifc.Operator):
|
||||
if not profile:
|
||||
|
||||
def msg(self, context):
|
||||
self.layout.label(text="INVALID PROFILE: " + indices[1])
|
||||
self.layout.label(text="INVALID PROFILE")
|
||||
|
||||
bpy.context.window_manager.popup_menu(msg, title="Error", icon="ERROR")
|
||||
ProfileDecorator.install(
|
||||
|
||||
@@ -1535,7 +1535,7 @@ class Model(bonsai.core.tool.Model):
|
||||
mesh: bpy.types.Mesh,
|
||||
position: Matrix | None = None,
|
||||
x_angle: Optional[float] = None,
|
||||
) -> Union[tuple, dict]:
|
||||
) -> tuple | dict | None:
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
|
||||
if position is None:
|
||||
@@ -1750,7 +1750,9 @@ class Model(bonsai.core.tool.Model):
|
||||
else:
|
||||
profile_defs.append(tmp.createIfcArbitraryClosedProfileDef("AREA", None, curve))
|
||||
|
||||
if len(profile_defs) == 1:
|
||||
if total_profile_defs := len(profile_defs) == 0:
|
||||
return
|
||||
elif total_profile_defs == 1:
|
||||
profile_def = profile_defs[0]
|
||||
else:
|
||||
profile_def = tmp.createIfcCompositeProfileDef("AREA", None, profile_defs)
|
||||
|
||||
Reference in New Issue
Block a user