From 0131fb770072dd1bdba81c0103b2379ae2f41c38 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 17 Aug 2019 06:12:27 +0300 Subject: [PATCH] - fixed error when creating CNCJob due of having the annotations disabled from preferences but the plot2() function from camlib.CNCJob class still performed operations who yielded TypeError exceptions --- README.md | 1 + camlib.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a359b2ab..3b552973 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing. 17.08.2019 - added estimated time of routing for the CNCJob and added travelled distance parameter for geometry, too +- fixed error when creating CNCJob due of having the annotations disabled from preferences but the plot2() function from camlib.CNCJob class still performed operations who yielded TypeError exceptions 17.08.2019 diff --git a/camlib.py b/camlib.py index ba01bf7e..ca12694d 100644 --- a/camlib.py +++ b/camlib.py @@ -6596,10 +6596,12 @@ class CNCjob(Geometry): if geo['kind'][0] == 'C': obj.add_shape(shape=poly, color=color['C'][1], face_color=color['C'][0], visible=visible, layer=1) - - obj.annotation.set(text=text, pos=pos, visible=obj.options['plot'], - font_size=self.app.defaults["cncjob_annotation_fontsize"], - color=self.app.defaults["cncjob_annotation_fontcolor"]) + try: + obj.annotation.set(text=text, pos=pos, visible=obj.options['plot'], + font_size=self.app.defaults["cncjob_annotation_fontsize"], + color=self.app.defaults["cncjob_annotation_fontcolor"]) + except Exception as e: + pass def create_geometry(self): # TODO: This takes forever. Too much data?