From a9dc71978b4e289552dccf7ce5aceb8aed88fbc6 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 23 Jul 2018 17:01:07 +0800 Subject: [PATCH] utils: handle exception in objName() --- utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils.py b/utils.py index 3c1aa79..e26cfc9 100644 --- a/utils.py +++ b/utils.py @@ -53,9 +53,12 @@ def addIconToFCAD(iconFile,path=None): return iconName def objName(obj): - if obj.Label == obj.Name: - return '"'+obj.Name+'"' - return '"{}({})"'.format(obj.Name,obj.Label) + try: + if obj.Label == obj.Name: + return '"'+obj.Name+'"' + return '"{}({})"'.format(obj.Name,obj.Label) + except Exception: + return '?' def isLine(param): if hasattr(Part,"LineSegment"):