mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 22:12: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"):
|
if element1.is_a("IfcFlowSegment") or element1.is_a("IfcFlowFitting"):
|
||||||
# lazy import to avoid circular import errors
|
# lazy import to avoid circular import errors
|
||||||
from bonsai.bim.module.model.mep import MEPGenerator
|
from bonsai.bim.module.model.mep import MEPGenerator
|
||||||
|
|
||||||
MEPGenerator().setup_ports(profile1["obj"])
|
MEPGenerator().setup_ports(profile1["obj"])
|
||||||
else:
|
else:
|
||||||
for profile1, profile2 in zip(profiles[:-1], profiles[1:]):
|
for profile1, profile2 in zip(profiles[:-1], profiles[1:]):
|
||||||
DumbProfileJoiner().join_V(profile2["obj"], profile1["obj"])
|
DumbProfileJoiner().join_V(profile2["obj"], profile1["obj"])
|
||||||
|
|
||||||
def modal(self, context, event):
|
def modal(self, context, event):
|
||||||
return IfcStore.execute_ifc_operator(self, context, event, method="MODAL")
|
return IfcStore.execute_ifc_operator(self, context, event, method="MODAL")
|
||||||
|
|||||||
@@ -130,11 +130,9 @@ class PortData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
obj = bpy.context.active_object
|
cls.element = None
|
||||||
assert obj
|
if obj := bpy.context.active_object:
|
||||||
element = tool.Ifc.get_entity(obj)
|
cls.element = tool.Ifc.get_entity(obj)
|
||||||
assert element
|
|
||||||
cls.element = element
|
|
||||||
is_port = cls.is_port()
|
is_port = cls.is_port()
|
||||||
cls.data = {
|
cls.data = {
|
||||||
"total_ports": cls.total_ports(),
|
"total_ports": cls.total_ports(),
|
||||||
|
|||||||
Reference in New Issue
Block a user