mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 19:36:21 +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:
|
if not profile:
|
||||||
|
|
||||||
def msg(self, context):
|
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")
|
bpy.context.window_manager.popup_menu(msg, title="Error", icon="ERROR")
|
||||||
ProfileDecorator.install(
|
ProfileDecorator.install(
|
||||||
|
|||||||
@@ -1535,7 +1535,7 @@ class Model(bonsai.core.tool.Model):
|
|||||||
mesh: bpy.types.Mesh,
|
mesh: bpy.types.Mesh,
|
||||||
position: Matrix | None = None,
|
position: Matrix | None = None,
|
||||||
x_angle: Optional[float] = None,
|
x_angle: Optional[float] = None,
|
||||||
) -> Union[tuple, dict]:
|
) -> tuple | dict | None:
|
||||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||||
|
|
||||||
if position is None:
|
if position is None:
|
||||||
@@ -1750,7 +1750,9 @@ class Model(bonsai.core.tool.Model):
|
|||||||
else:
|
else:
|
||||||
profile_defs.append(tmp.createIfcArbitraryClosedProfileDef("AREA", None, curve))
|
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]
|
profile_def = profile_defs[0]
|
||||||
else:
|
else:
|
||||||
profile_def = tmp.createIfcCompositeProfileDef("AREA", None, profile_defs)
|
profile_def = tmp.createIfcCompositeProfileDef("AREA", None, profile_defs)
|
||||||
|
|||||||
Reference in New Issue
Block a user