Skip to content

Commit

Permalink
utils: fix isElement()
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Jul 2, 2019
1 parent 56afcb6 commit c927d00
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions utils.py
Expand Up @@ -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 \
Expand Down

0 comments on commit c927d00

Please sign in to comment.