Просмотр исходного кода

- 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

Marius Stanciu 6 лет назад
Родитель
Сommit
0131fb7700
2 измененных файлов с 7 добавлено и 4 удалено
  1. 1 0
      README.md
  2. 6 4
      camlib.py

+ 1 - 0
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
 

+ 6 - 4
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?