Allow selection of edges for engraving.

This commit is contained in:
Markus Lampert
2018-06-04 12:06:42 +02:00
committed by wmayer
parent 13bce09608
commit 60a49ede57
+17 -10
View File
@@ -45,16 +45,23 @@ class MESHGate:
class ENGRAVEGate:
def allow(self, doc, obj, sub):
engraveable = False
if hasattr(obj, "Shape"):
if obj.Shape.BoundBox.ZLength == 0.0:
try:
obj = obj.Shape
except:
return False
if len(obj.Wires) > 0:
engraveable = True
return engraveable
try:
shape = obj.Shape
except:
return False
if shape.BoundBox.ZLength == 0.0 and len(obj.Wires) > 0:
return True
if shape.ShapeType == 'Edge':
return True
if sub:
subShape = shape.getElement(sub)
if subShape.ShapeType == 'Edge':
return True
return False
class DRILLGate: