From b3be19052955da74de4cd1682b3136bc061bbb18 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Thu, 24 Aug 2017 08:32:07 -0500 Subject: [PATCH] Path: gui cleanup --- src/Mod/Path/PathScripts/PathArray.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathArray.py b/src/Mod/Path/PathScripts/PathArray.py index 2aaa3a789c..2a0c3849fc 100644 --- a/src/Mod/Path/PathScripts/PathArray.py +++ b/src/Mod/Path/PathScripts/PathArray.py @@ -25,7 +25,8 @@ import FreeCAD import FreeCADGui import Path -from PySide import QtCore, QtGui +import PathScripts +from PySide import QtCore import math """Path Array object and FreeCAD command""" @@ -240,11 +241,13 @@ class CommandPathArray: 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path_Array", "Creates an array from a selected path")} def IsActive(self): - if FreeCAD.ActiveDocument is not None: - for o in FreeCAD.ActiveDocument.Objects: - if o.Name[:3] == "Job": - return True - return False + if bool(FreeCADGui.Selection.getSelection()) is False: + return False + try: + obj = FreeCADGui.Selection.getSelectionEx()[0].Object + return isinstance(obj.Proxy, PathScripts.PathOp.ObjectOp) + except: + return False def Activated(self):