Question with 2 choice

Hi !
I need to create a question with 2 choice for example :

"What do you want ?"

- Do (choice 1)
- I don't want (choice 2)
- Cancel

when choice 1 is pressed do ...

when choice 2 is pressed do ...

when cancel is pressed do ...
Stop the script

How translate that in Maxscript ?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture
Kasimashi's picture

:)

Can we create a answer without " yesNoCancelBox " ?

barigazy's picture

...

answer = yesNoCancelBox "Yes - to delete all children\nNo - to delete all parents" title:"" beep:off
case answer of
(
	(#yes): delete (for o in objects where matchPattern o.name pattern:"*2_*" collect o)
	(#no): delete (for o in objects where matchPattern o.name pattern:"*2_*" and o.parent != undefined collect o.parent)
	(default): print "Canceled!"
)

bga

barigazy's picture

without YesNoCancelBox

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "• • •"
(
	edittext sufix "Sufix Pattern:" text:"2_"
	button btn_delchilds "Delete childrens" pos:[5,25] width:100 height:20 
	button btn_delparents "Delete parents" pos:[110,25] width:100 height:20
	on btn_delchilds pressed do
	(
		delete (for o in objects where matchPattern o.name pattern:("*"+sufix.text+"*") collect o)
	)
 
	on btn_delparents pressed do
	(
		delete (for o in objects where matchPattern o.name pattern:("*"+sufix.text+"*") and o.parent != undefined collect o.parent)
	)
)
createDialog bgaRoll 220 50 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

Kasimashi's picture

Thanks You !!!

Thanks you veru mush barigazy :D

I'll to learn Max script because I'm bad at it today , I know do a little script with step but never a complete script :(

Have a nice day ! :)

Regards

Kasimashi

barigazy's picture

...

Just start with basic stuff, see this training if you already not http://vimeo.com/album/1514565 , read mxs help and ask forum if you have problem with you code. Is that simple or not? :)
Cheers!
Branko

bga

barigazy's picture

:) funny answer

if queryBox "Do you want to create a box" beep:false then Box() else print "No Box for you :)"

bga

Kasimashi's picture

:p

Thanks but In fact I need :

A question say :

"Do you want a destroy or standart batiment?"

- Standard (choice 1)
- Destroy (choice 2)
- Cancel

if choice 1 is pressed do :

select (for o in objects where matchPattern o.name pattern:"*2_*" collect o) delete $

if choice 2 is pressed do :

select Parent of the children are exist and delete them.

like this : http://img15.hostingpics.net/pics/142816parentofchildren.png

if cancel is pressed :

stop the script

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.