From c927d00b4d7080d868ddcf902b85a63ea5dcd5c6 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 2 Jul 2019 10:43:51 +0800 Subject: [PATCH] utils: fix isElement() --- utils.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/utils.py b/utils.py index 33a5a80..0b89251 100644 --- a/utils.py +++ b/utils.py @@ -179,15 +179,8 @@ def isDraftObject(obj): return isDraftCircle(obj) def isElement(obj): - if not isinstance(obj,(tuple,list)): - shape = obj - else: - sobj,_,shape = obj[0].getSubObject(obj[1],2) - if not sobj: - return - if not shape: - return sobj.TypeId in ('App::Line','App::Plane','App::Placement') - if isinstance(obj,(Part.Vertex,Part.Face,Part.Edge)): + shape = getElementShape(obj) + if isinstance(shape,(Part.Vertex,Part.Face,Part.Edge)): return True if isinstance(shape,Part.Shape): return shape.countElement('Vertex')==1 or \