Arch: Fix issue with getSceneGraph

Same issue as in #8171
This commit is contained in:
Roy-043
2023-11-05 20:48:43 +01:00
parent d40e1dff19
commit 40f1bba270
2 changed files with 20 additions and 5 deletions

View File

@@ -808,7 +808,9 @@ class ViewProviderBuildingPart:
if hasattr(vobj,prop) and hasattr(child.ViewObject,prop[8:]) and not hasattr(child,"ChildrenOverride"):
setattr(child.ViewObject,prop[8:],getattr(vobj,prop))
elif prop in ["CutView","CutMargin"]:
if hasattr(vobj,"CutView") and FreeCADGui.ActiveDocument.ActiveView:
if hasattr(vobj, "CutView") \
and FreeCADGui.ActiveDocument.ActiveView \
and hasattr(FreeCADGui.ActiveDocument.ActiveView, "getSceneGraph"):
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
if vobj.CutView:
from pivy import coin