utils: handle exception in objName()
This commit is contained in:
parent
1b43f4f701
commit
a9dc71978b
3
utils.py
3
utils.py
|
@ -53,9 +53,12 @@ def addIconToFCAD(iconFile,path=None):
|
||||||
return iconName
|
return iconName
|
||||||
|
|
||||||
def objName(obj):
|
def objName(obj):
|
||||||
|
try:
|
||||||
if obj.Label == obj.Name:
|
if obj.Label == obj.Name:
|
||||||
return '"'+obj.Name+'"'
|
return '"'+obj.Name+'"'
|
||||||
return '"{}({})"'.format(obj.Name,obj.Label)
|
return '"{}({})"'.format(obj.Name,obj.Label)
|
||||||
|
except Exception:
|
||||||
|
return '?'
|
||||||
|
|
||||||
def isLine(param):
|
def isLine(param):
|
||||||
if hasattr(Part,"LineSegment"):
|
if hasattr(Part,"LineSegment"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user