utils: fix isElement()
This commit is contained in:
parent
56afcb63d8
commit
c927d00b4d
11
utils.py
11
utils.py
|
@ -179,15 +179,8 @@ def isDraftObject(obj):
|
||||||
return isDraftCircle(obj)
|
return isDraftCircle(obj)
|
||||||
|
|
||||||
def isElement(obj):
|
def isElement(obj):
|
||||||
if not isinstance(obj,(tuple,list)):
|
shape = getElementShape(obj)
|
||||||
shape = obj
|
if isinstance(shape,(Part.Vertex,Part.Face,Part.Edge)):
|
||||||
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)):
|
|
||||||
return True
|
return True
|
||||||
if isinstance(shape,Part.Shape):
|
if isinstance(shape,Part.Shape):
|
||||||
return shape.countElement('Vertex')==1 or \
|
return shape.countElement('Vertex')==1 or \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user