mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
black .
This commit is contained in:
@@ -1136,8 +1136,7 @@ class DrawPolylineProfile(bpy.types.Operator, PolylineOperator, tool.Ifc.Operato
|
||||
DumbProfileJoiner().join_V(profile2["obj"], profile1["obj"])
|
||||
if connect_IfcFlowSegments:
|
||||
bpy.ops.bim.mep_connect_elements(
|
||||
obj1_name=profile1["obj"].name,
|
||||
obj2_name=profile2["obj"].name
|
||||
obj1_name=profile1["obj"].name, obj2_name=profile2["obj"].name
|
||||
)
|
||||
|
||||
def modal(self, context, event):
|
||||
|
||||
@@ -370,7 +370,7 @@ class BIMProjectProperties(PropertyGroup):
|
||||
load_indexed_maps: BoolProperty(
|
||||
name="Load Indexed Maps",
|
||||
description="Load indexed maps (UV and color maps)",
|
||||
default=False, # Very slow and hackishly implemented
|
||||
default=False, # Very slow and hackishly implemented
|
||||
)
|
||||
links: CollectionProperty(name="Links", type=Link)
|
||||
active_link_index: IntProperty(name="Active Link Index")
|
||||
|
||||
@@ -172,7 +172,7 @@ class IfcClassData:
|
||||
),
|
||||
)
|
||||
)
|
||||
if (ifc_class and "IfcCableCarrierSegment" in ifc_class):
|
||||
if ifc_class and "IfcCableCarrierSegment" in ifc_class:
|
||||
templates.extend(
|
||||
(
|
||||
(
|
||||
@@ -182,7 +182,7 @@ class IfcClassData:
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if ifc_class.endswith("Type") or ifc_class.endswith("Style"):
|
||||
templates.extend(
|
||||
[
|
||||
|
||||
@@ -703,7 +703,9 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
|
||||
default_thickness = 0.005
|
||||
default_inner_fillet_radius = 0.005
|
||||
default_outer_fillet_radius = 0.005
|
||||
profile_name = f"{props.ifc_class}-{default_x_dim*1000}x{default_y_dim*1000}x{default_thickness*1000}"
|
||||
profile_name = (
|
||||
f"{props.ifc_class}-{default_x_dim*1000}x{default_y_dim*1000}x{default_thickness*1000}"
|
||||
)
|
||||
profile = tool.Ifc.get().create_entity(
|
||||
"IfcRectangleHollowProfileDef",
|
||||
ProfileName=profile_name,
|
||||
|
||||
@@ -488,12 +488,11 @@ class EstablishPathDirection(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
def _execute(self, context):
|
||||
connected_port = tool.Ifc.get().by_id(self.port_id)
|
||||
|
||||
|
||||
|
||||
if not connected_port or not connected_port.is_a("IfcDistributionPort"):
|
||||
self.report({"ERROR"}, "Invalid port specified.")
|
||||
return {"CANCELLED"}
|
||||
|
||||
|
||||
direction_map = {
|
||||
"SOURCE": "SINK",
|
||||
"SINK": "SOURCE",
|
||||
@@ -503,28 +502,28 @@ class EstablishPathDirection(bpy.types.Operator, tool.Ifc.Operator):
|
||||
next_element = tool.System.get_port_relating_element(connected_port)
|
||||
ports = tool.System.get_ports(next_element)
|
||||
segments_processed = 0
|
||||
while (len(ports) == 2):
|
||||
while len(ports) == 2:
|
||||
if ports[0].id() == connected_port.id():
|
||||
other_port = ports[1]
|
||||
else:
|
||||
other_port = ports[0]
|
||||
|
||||
|
||||
new_direction = direction_map.get(connected_port.FlowDirection, "NOTDEFINED")
|
||||
other_port.FlowDirection = new_direction
|
||||
segments_processed += 1
|
||||
|
||||
|
||||
connected_port = tool.System.get_connected_port(other_port)
|
||||
if not connected_port:
|
||||
break
|
||||
connected_port.FlowDirection = direction_map.get(other_port.FlowDirection, "NOTDEFINED")
|
||||
next_element = tool.System.get_port_relating_element(connected_port)
|
||||
|
||||
|
||||
if not next_element.is_a("IfcFlowSegment"):
|
||||
print(f"DEBUG: next_element is not IfcFlowSegment, stopping")
|
||||
break
|
||||
|
||||
|
||||
ports = tool.System.get_ports(next_element)
|
||||
|
||||
|
||||
self.report({"INFO"}, f"Established path direction through {segments_processed} flow segment(s).")
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -333,7 +333,9 @@ class BIM_PT_port(Panel):
|
||||
else:
|
||||
cols[7].label(text="", icon="BLANK1")
|
||||
cols[8].label(text="")
|
||||
cols[9].operator("bim.establish_path_direction", text="", icon="CON_FOLLOWPATH").port_id = connected_port.id()
|
||||
cols[9].operator("bim.establish_path_direction", text="", icon="CON_FOLLOWPATH").port_id = (
|
||||
connected_port.id()
|
||||
)
|
||||
else:
|
||||
cols[4].label(text="", icon="BLANK1")
|
||||
cols[5].label(text="", icon="BLANK1")
|
||||
|
||||
Reference in New Issue
Block a user