Can't run Command from custom Python Command in Rhino 6

I have previously made some custom Python commands in Rhino 5, but when trying them out in Rhino 6, commands that calls commands in the Rhino Commandline doesn’t work anymore. Calling rhino commands from a python script directly in the Python editor works fine. I have tried with both rhinoscriptsyntax and RhinoCommon. Example of python command not working:

import rhinoscriptsyntax as rs

__commandname__ = "Test"

def RunCommand( is_interactive ):
    rs.Command("Line ")
    return 0

However calling this from the python editor works:

import rhinoscriptsyntax as rs

__commandname__ = "Test"

def RunCommand( is_interactive ):
    rs.Command("Line ")
    return 0
RunCommand(True)

And all other custom python commands without rs.Command("rhinocommand") works fine

I’m having the same problem… Any update on this issue?

no :frowning:

Please, someone at McNeel, we need a solution!

@piac, is this something up your alley?

I logged this and we’re looking into it.
Thanks.

1 Like

Any solution for this problem? Still waiting!

Hi, this was fixed a while ago. I just tested again to make sure.
Could you describe the problem you’re having?

Not sure if this will solve your problem but according to the docs for your Python command to be recognised on the command line Python needs to be loaded. You can do this by typing EditPythonScript after you start Rhino. This isn’t very user friendly when you want to distribute your Python plugins so C# plugins might be a better option.

Note : Sometimes, using this system, Rhino requires that Python be loaded before it can see the new command for the first time in a session - running EditPythonScript , or any other python script should allow the command to work.

Hi Lasse,

maybe try to replace the line of "rs.Command("Line “)” with

“rs.Command(”_Line")" , and there’s a link might help: https://developer.rhino3d.com/api/RhinoScriptSyntax/#collapse-Command