mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
black .
This commit is contained in:
@@ -260,7 +260,6 @@ class SaveBlendMetadataFile(bpy.types.Operator):
|
||||
self.report({"WARNING"}, "No IFC file path set.")
|
||||
return {"CANCELLED"}
|
||||
|
||||
|
||||
blendmetadata_path = ifc_file + ".metadata.blend"
|
||||
|
||||
ifc_dir = os.path.dirname(ifc_file)
|
||||
@@ -332,12 +331,14 @@ except Exception:
|
||||
bpy.ops.wm.save_as_mainfile(filepath=r'{blendmetadata_path}')
|
||||
"""
|
||||
import tempfile
|
||||
|
||||
with tempfile.NamedTemporaryFile("w", suffix=".py", delete=False) as script_file:
|
||||
script_file.write(cleanup_script)
|
||||
script_path = script_file.name
|
||||
|
||||
blender_exe = bpy.app.binary_path
|
||||
import subprocess
|
||||
|
||||
result = subprocess.run(
|
||||
[blender_exe, temp_path, "--background", "--python", script_path], capture_output=True, text=True
|
||||
)
|
||||
|
||||
@@ -488,28 +488,28 @@ def sync_references(
|
||||
|
||||
for element in potential_reference_elements:
|
||||
# Skip spatial elements - their IFC placement is the source of truth
|
||||
if element.is_a("IfcSpatialElement"):
|
||||
if element.is_a("IfcSpatialElement"):
|
||||
continue
|
||||
|
||||
|
||||
# Skip grids - their IFC placement is the source of truth
|
||||
if element.is_a("IfcGrid") or element.is_a("IfcGridAxis"):
|
||||
continue
|
||||
|
||||
|
||||
if (obj := ifc.get_object(element)) and ifc.is_moved(obj):
|
||||
drawing_tool.sync_object_placement(obj)
|
||||
|
||||
for element in drawing_tool.get_group_elements(group):
|
||||
if not drawing_tool.is_auto_annotation(element):
|
||||
continue
|
||||
|
||||
|
||||
# Skip spatial elements - should never sync their placement
|
||||
if element.is_a("IfcSpatialElement"):
|
||||
continue
|
||||
|
||||
|
||||
# Skip grids
|
||||
if element.is_a("IfcGrid") or element.is_a("IfcGridAxis"):
|
||||
continue
|
||||
|
||||
continue
|
||||
|
||||
if (obj := ifc.get_object(element)) and ifc.is_moved(obj):
|
||||
drawing_tool.sync_object_placement(obj)
|
||||
if not (reference_element := drawing_tool.get_assigned_product(element)):
|
||||
|
||||
Reference in New Issue
Block a user