You need a msgbox

http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/XSIUIToolkit.MsgBox.html

1 is the ok/cancel style box, if you then print the variable you will see
the result of what they picked, as you can see it returns 1 if the user
clicked ok, or 2 if the cancelled (or pressed x)

EG:

box = XSIUIToolkit.MsgBox('hello', 1, 'lalal' )
print box


if box == 1:
print 'ok'
if box == 2:
print 'cancelled'


for 2) if you are doing stuff with v### and file paths I recommend you use
regular expression though daunting, sites like this are extremely useful

http://regexr.com/






Simon Reeves
London, UK
*[email protected] <[email protected]>*
*www.simonreeves.com <http://www.simonreeves.com>*
*www.analogstudio.co.uk <http://www.analogstudio.co.uk>*

On 17 November 2014 13:16, Jonny Grew <[email protected]> wrote:

> Hi list.
>
> A real novice at this but I'm butchering various scripts at the moment and
> wondered if anyone can shed any light on these two bits of code. I can find
> examples of number 1 in VB but I'm working in Python. everything I've
> discovered at the moment doesn't work
>
> 1 - I want to run 2 portions of scripts depending on whether the inspected
> property of a custom parameter set has the button push 'ok' or 'cancel'  -
> I can't find the code for this portion of the 'if' statement
>
> 2 (a lot more complex, i suspect) I want to look up and get the latest
> version number of a saved out model/scene/action (all of these have the
> format "v##'). These will live in a folder structure determined by a number
> of variables in the script that I have already. My script will then add 1
> to this number in order to ensure the next export doesn't override an
> existing asset. As a bonus... if the user changes this number meaning an
> export would save over an existing asset then it would be great to flag a
> warning with an 'THIS VERSION ALREADY EXISTS ARE YOU SURE" message.
>
> Any tips or links to scripts that I can hack would be much appreciated!
>
> Cheers
> Jonny
>
>
>

Reply via email to