SendKeystrokes and SetActiveViewport doesn't work

Hello,

I try to use the command _SetActiveViewport and it’s work only if there is no script/command after
Like this it’s working :
rs.SendKeystrokes(’_SelNone _SetActiveViewport Top’)
Like this is not working :
rs.SendKeystrokes(’_SelNone _SetActiveViewport Top _CPlane _World’)
It ask me the name again and again. I try to put “_Pause” or write it in all different way, that change nothing.

Have you any idea why ?

Thank you,
Antoine

Hi @antoine.allaz,

This is a better approach:

import rhinoscriptsyntax as rs
rs.Command('_SelNone')
rs.Command('_SetActiveViewport _Top')
rs.Command('_CPlane _World _Top')

More on the Command method:

https://developer.rhino3d.com/api/RhinoScriptSyntax/#application-Command

– Dale

Hello,

Thank you very much. I didn’t use is because I didn’t know how to mix with data from the script and finally it’s working like this
rs.Command(’_CPlane ’ +data)

Thanks a lot !