Command Failure for External Command

Wasn’t sure of the best category to put his under so I apologize ahead of time. I tried to pass a string to to my wpf that contained “°” the degree symbol. I achieved this degree symbol in my VS Code text editor my typing alt+0176. When I ran it I got a Revit “Command Failure for External Command”. I removed the degree symbol and have restarted Revit but the command is still returning the same error. I am guessing Revit has a log file that this command was logged too and therefore continues the same error. If this is so does anyone have any recommendations on how to edit this log file? Most of my searching on this command was saying to re-install Revit but I would rather not have to go through that step if avoidable. I was also considering renaming my command (not sure if that would work). But am curious if there is a better fix.

Thanks in advance for any help!

Hi,

Without seeing your code its hard to be sure but this below produces the same error:

 print("°") 

To correct this add # -- coding: UTF-8 -- to the top of you script:

# -*- coding: UTF-8 -*-

print("°")

Alternatively you can use unicode formatting like:

print("This is the unicode degree symbol:" + u'\xb0')

1 Like

Thank you so much! worked like a charm, degree symbol is now working!

image

1 Like