Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5825

OnCancelScript

$
0
0

@declan wrote:

Hi all,

I’m going to go ahead and apologize for being a noob, and also for the fact that I can’t post my code because it is work-related. Hopefully I can describe my issue well enough…

I have a .rs that prompts the user to select some parts. The selection is evaluated: “If Not IsNull(ArrObjects) Then…” and the parts are put on a specific layer. The script then asks the user for a second set which are put on a specific layer, and a third set.

What I’m trying to do is enable the Esc key to bail out of the script by using OnCancelScript, which I’ve figured out. But I also want to enable the Enter key to skip over selection set 1 (sometimes that set is not present). Unfortunately, I’m calling OnCancelScript via the IsNotNull / Else which is also triggered by Enter.

So I don’t have a way to differentiate Esc from Enter. Does that make sense?

And on a related note, how to I get OnCancelScript to simply exit the script. Is there no “Quit Script” or “Exit” etc?

Thanks in advance!!

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 5825

Trending Articles