Merge pull request #22374 from z0r0/CAM-Inspect-Fix

CAM: Fixing Length Check in CommandPathInspect class
This commit is contained in:
sliptonic
2025-07-17 13:40:08 -05:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -260,7 +260,10 @@ class CommandPathInspect:
}
def IsActive(self):
obj = FreeCADGui.Selection.getSelection()[0]
selection = FreeCADGui.Selection.getSelection()
if len(selection) == 0:
return False
obj = selection[0]
return hasattr(obj, "Path") and len(obj.Path.Commands) > 0
def Activated(self):

View File

@@ -56,7 +56,10 @@ class CommandCAMSanity:
}
def IsActive(self):
obj = FreeCADGui.Selection.getSelectionEx()[0].Object
selection = FreeCADGui.Selection.getSelectionEx()
if len(selection) == 0:
return False
obj = selection[0].Object
return isinstance(obj.Proxy, Path.Main.Job.ObjectJob)
def Activated(self):