This commit is contained in:
Andrej730
2025-12-22 18:59:58 +05:00
parent 3a697e3062
commit a3fda66dec
2 changed files with 9 additions and 8 deletions
+2 -1
View File
@@ -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
)
+7 -7
View File
@@ -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)):