From 5e90dc86fb8cc0f61a18a280cda1949c39ffaa62 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:59:13 +0100 Subject: [PATCH] BIM: BIM_Material: only assign material object to component (#25823) * Add MoveWithHost check for material assignment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Mod/BIM/bimcommands/BimMaterial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/BIM/bimcommands/BimMaterial.py b/src/Mod/BIM/bimcommands/BimMaterial.py index b7f3b71d9f..6c3250ef67 100644 --- a/src/Mod/BIM/bimcommands/BimMaterial.py +++ b/src/Mod/BIM/bimcommands/BimMaterial.py @@ -545,7 +545,7 @@ class Arch_Material: FreeCADGui.Control.closeDialog() FreeCADGui.doCommand("mat = Arch.makeMaterial()") for obj in sel: - if hasattr(obj, "Material"): + if hasattr(obj, "Material") and hasattr(obj, "MoveWithHost"): # 'isComponent' check FreeCADGui.doCommand( 'FreeCAD.ActiveDocument.getObject("' + obj.Name + '").Material = mat' )