Gracefully handle op creation abort when no TC is available or selected.

This commit is contained in:
markus
2022-02-15 13:37:44 -08:00
parent 6e012520d9
commit 09c10dada0
3 changed files with 35 additions and 11 deletions

View File

@@ -68,6 +68,13 @@ FeatureDiameters = 0x4000 # Turning Diameters
FeatureBaseGeometry = FeatureBaseVertexes | FeatureBaseFaces | FeatureBaseEdges
class PathNoTCException(Exception):
'''PathNoTCException is raised when no TC was selected or matches the input
criteria. This can happen intentionally by the user when they cancel the TC
selection dialog.'''
def __init__(self):
super().__init__('No Tool Controller found')
class ObjectOp(object):
"""
@@ -568,7 +575,7 @@ class ObjectOp(object):
else:
obj.ToolController = PathUtils.findToolController(obj, self)
if not obj.ToolController:
return None
raise PathNoTCException()
obj.OpToolDiameter = obj.ToolController.Tool.Diameter
if FeatureCoolant & features: