utils: handle exception in objName()

This commit is contained in:
Zheng, Lei 2018-07-23 17:01:07 +08:00
parent 1b43f4f701
commit a9dc71978b

View File

@ -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"):