How do I script pressing the return button in Python for Rhino please

Hi, can someone please tell me how to script pressing the return key to accept a setting.I can get commands to work with my python scripts but it always pauses if there are options to accept. Since I am happy with the defaults I would like my script to move on to the next command without my having to accept manually. Is this possible?

Hi @giusseppe,

Use _Enter.

Command macros and scripting

– Dale

Do I have to put that inside an rs.Command()
It doesnt seem to work on its own
eg…
rs.Command(“CurveThroughPt”, echo=True,)
_Enter

still stops and asks me to press Enter to accept options

Yes you put it all in the command script, if the command doesn’t finish it will just stay in it.

Sorry to bring this up again but whereas _Enter works in a Macro it does not seem to work in Python…
_SelPt
_CurveThroughPt
_Enter
is fine as a Macro

but these scripts always ask me to confirm for _CurveThroughPt (I have also tried_EnterEnd)

import rhinoscriptsyntax as rs

rs.Command("_SelPt",echo=True)
rs.Command("_CurveThroughPt",echo=True)
rs.Command("_Enter")

or

rs.Command("_SelPt",echo=True)
rs.Command("_CurveThroughPt","_Enter")

In both of your examples you failed to put your extra Enter inside the same Command string. In the second I presume gave you some sort of error, that’s not how it works its’ “CurveThroughPt Enter”

Thank you Jim,
That works fine,I thought that I could not put more than one command in the string
Giusseppe