Verifies that a command exists in Rhino. The function is useful when scripting commands found in 3rd party plug-ins.
rhinoscriptsyntax.IsCommand( command_name )
rhinoscript.application.IsCommand( command_name )
command_name |
Required. String. The command name to test. |
Boolean |
True if command exists, otherwise False. |
import rhinoscriptsyntax as rs
cmdname = rs.GetString("Command name to test")
if cmdname is not None:
iscmd = rs.IsCommand(cmdname)
if iscmd:
print "The", cmdname, "command exists."
else:
print "The", cmdname, "command does not exist."