Running multiple commands consecutively (RunScript & Command)

Problem:

I am trying to run multiple commands in Python using rs.Command & Rhino.RhinoApp.RunScript.
Rather then having commands run consecutively, they ran in a opposite order and only after the python script execution was completed.

Example:

rs.Command('-_SelNone')
rs.Command('-_SelLayer "first"')
# do stuff like change materials, v-ray rendering
rs.Command('-_SelNone')
rs.Command('-_SelLayer "second"')
rs.Command('-_SelNone')

Result:

First command is completely ignored and the second layer is selected before the first.
Trying to find a way to have these commands executed consecutively.
I am using RhinoScript rather then Python because I need to change materials & execute batch rendering.
I have yet to find these commands in directly in Python.

@pascal, @Alain, have you heard of this?

Not I…

-Pascal

Without being able to actually test from my phone, I suggest to add a space character after “first” and after all commands; I expect the commands not to finish without it.

-Willem

I can’t duplicate this in Rhino 5, wip, or Rhino for Mac. I’m doing simple things like moving stuff around and prompting the user for input in between the commands. Are you using Rhino 5?

Sorry for the late response. I am using GemVision Matrix which is based on Rhino 5.

As for the Python Commands being executed out of order, I ended up restarting the software and Vray options to default. The weird behaviour hasn’t occurred since.