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>
This commit is contained in:
@@ -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'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user