hello everyone.
Probably I found a bug with the VBScript. I was creating and experimenting a lot with the VBScript function if-then-elseif-else statement and I found something that before saving my drawing was working, but know that I was checking again simply stop working.
![](https://autodesk.i.lithium.com/t5/image/serverpage/image-id/771629i7B87807AA29C75AC/image-size/large?v=1.0&px=999)
I was linking multiple functions to the function name "NAME_BY_OBJECT" which generates a different name per each different object. In images 1 and 2, everything is correct...
... but something weird happens with I add the object type "Hanger":
![](https://autodesk.i.lithium.com/t5/image/serverpage/image-id/771635iEDEC520E8B32A5B7/image-size/large?v=1.0&px=999)
... again everything works correct, but just with hangers, but I was checking the cable trays and cable trays fitting this happens:
![](https://autodesk.i.lithium.com/t5/image/serverpage/image-id/771637i74CB5588299BD78B/image-size/large?v=1.0&px=999)
I do not what happens here.
Then:
1) am I doing something bad?
2)if yes, how can I fix this?
3) if not, What Is wrong, and what alternatives exist?
PD: attached files
before:
If "[ObjectType]" = "Cable Tray" Then
RESULT = "[NAME_CABLE_TRAY]"
ElseIf "[ObjectType]" = "Cable Tray Fitting" Then
RESULT = "[NAME_CABLE_TRAY_FITTING]"
Else
RESULT = "NA"
End If
after:
If "[ObjectType]" = "Cable Tray" Then
RESULT = "[NAME_CABLE_TRAY]"
ElseIf "[ObjectType]" = "Cable Tray Fitting" Then
RESULT = "[NAME_CABLE_TRAY_FITTING]"
ElseIf "[ObjectType]" = "Hanger" Then
RESULT = "[NAME_HANGER]"
Else
RESULT = "NA"
End If