mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix syntax error otherwise nothing loads
Also PortData is loaded in the authoring tool and there might not be any active object (e.g. fresh session).
This commit is contained in:
@@ -1154,10 +1154,11 @@ class DrawPolylineProfile(bpy.types.Operator, PolylineOperator, tool.Ifc.Operato
|
||||
if element1.is_a("IfcFlowSegment") or element1.is_a("IfcFlowFitting"):
|
||||
# lazy import to avoid circular import errors
|
||||
from bonsai.bim.module.model.mep import MEPGenerator
|
||||
|
||||
MEPGenerator().setup_ports(profile1["obj"])
|
||||
else:
|
||||
for profile1, profile2 in zip(profiles[:-1], profiles[1:]):
|
||||
DumbProfileJoiner().join_V(profile2["obj"], profile1["obj"])
|
||||
else:
|
||||
for profile1, profile2 in zip(profiles[:-1], profiles[1:]):
|
||||
DumbProfileJoiner().join_V(profile2["obj"], profile1["obj"])
|
||||
|
||||
def modal(self, context, event):
|
||||
return IfcStore.execute_ifc_operator(self, context, event, method="MODAL")
|
||||
|
||||
@@ -130,11 +130,9 @@ class PortData:
|
||||
|
||||
@classmethod
|
||||
def load(cls):
|
||||
obj = bpy.context.active_object
|
||||
assert obj
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
assert element
|
||||
cls.element = element
|
||||
cls.element = None
|
||||
if obj := bpy.context.active_object:
|
||||
cls.element = tool.Ifc.get_entity(obj)
|
||||
is_port = cls.is_port()
|
||||
cls.data = {
|
||||
"total_ports": cls.total_ports(),
|
||||
|
||||
Reference in New Issue
Block a user