mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
black format
This commit is contained in:
@@ -99,15 +99,18 @@ class Root(blenderbim.core.tool.Root):
|
|||||||
if not element:
|
if not element:
|
||||||
continue
|
continue
|
||||||
if hasattr(element, "ConnectedTo") and element.ConnectedTo:
|
if hasattr(element, "ConnectedTo") and element.ConnectedTo:
|
||||||
paths = [connection for connection in element.ConnectedTo if connection.is_a("IfcRelConnectsPathElements")]
|
paths = [
|
||||||
|
connection for connection in element.ConnectedTo if connection.is_a("IfcRelConnectsPathElements")
|
||||||
|
]
|
||||||
for path in paths:
|
for path in paths:
|
||||||
relationships[element] = {"type": "path",
|
relationships[element] = {
|
||||||
"related_connection_type": path.RelatedConnectionType,
|
"type": "path",
|
||||||
"related_element": path.RelatedElement,
|
"related_connection_type": path.RelatedConnectionType,
|
||||||
"related_priorities": path.RelatedPriorities,
|
"related_element": path.RelatedElement,
|
||||||
"relating_connection_type": path.RelatingConnectionType,
|
"related_priorities": path.RelatedPriorities,
|
||||||
"relating_element": path.RelatingElement,
|
"relating_connection_type": path.RelatingConnectionType,
|
||||||
"relating_priorities": path.RelatingPriorities,
|
"relating_element": path.RelatingElement,
|
||||||
|
"relating_priorities": path.RelatingPriorities,
|
||||||
}
|
}
|
||||||
return relationships
|
return relationships
|
||||||
|
|
||||||
@@ -236,7 +239,6 @@ class Root(blenderbim.core.tool.Root):
|
|||||||
related_connection=data["related_connection_type"],
|
related_connection=data["related_connection_type"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def recreate_aggregate(cls, old_to_new):
|
def recreate_aggregate(cls, old_to_new):
|
||||||
for old, new in old_to_new.items():
|
for old, new in old_to_new.items():
|
||||||
@@ -246,21 +248,21 @@ class Root(blenderbim.core.tool.Root):
|
|||||||
new_aggregate = old_to_new[old_aggregate]
|
new_aggregate = old_to_new[old_aggregate]
|
||||||
except:
|
except:
|
||||||
blenderbim.core.aggregate.unassign_object(
|
blenderbim.core.aggregate.unassign_object(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
tool.Aggregate,
|
tool.Aggregate,
|
||||||
tool.Collector,
|
tool.Collector,
|
||||||
relating_obj=tool.Ifc.get_object(old_aggregate),
|
relating_obj=tool.Ifc.get_object(old_aggregate),
|
||||||
related_obj=tool.Ifc.get_object(new[0]),
|
related_obj=tool.Ifc.get_object(new[0]),
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
blenderbim.core.aggregate.assign_object(
|
blenderbim.core.aggregate.assign_object(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
tool.Aggregate,
|
tool.Aggregate,
|
||||||
tool.Collector,
|
tool.Collector,
|
||||||
relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
||||||
related_obj=tool.Ifc.get_object(new[0]),
|
related_obj=tool.Ifc.get_object(new[0]),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make sure that the array children also get reassigned to the correct aggregate
|
# Make sure that the array children also get reassigned to the correct aggregate
|
||||||
pset = ifcopenshell.util.element.get_pset(new[0], "BBIM_Array")
|
pset = ifcopenshell.util.element.get_pset(new[0], "BBIM_Array")
|
||||||
@@ -268,13 +270,12 @@ class Root(blenderbim.core.tool.Root):
|
|||||||
array_children = tool.Blender.Modifier.Array.get_all_children_objects(new[0])
|
array_children = tool.Blender.Modifier.Array.get_all_children_objects(new[0])
|
||||||
for obj in array_children:
|
for obj in array_children:
|
||||||
blenderbim.core.aggregate.assign_object(
|
blenderbim.core.aggregate.assign_object(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
tool.Aggregate,
|
tool.Aggregate,
|
||||||
tool.Collector,
|
tool.Collector,
|
||||||
relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
||||||
related_obj=tool.Ifc.get_object(tool.Ifc.get_entity(obj)),
|
related_obj=tool.Ifc.get_object(tool.Ifc.get_entity(obj)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run_geometry_add_representation(
|
def run_geometry_add_representation(
|
||||||
|
|||||||
Reference in New Issue
Block a user