Can anyone help with checking a checkbutton via UIAccessor?
Hello Folks,
I really appreciate the time and assistance everyone provides on this forum, and so wanted ask for some help.
I am trying to check a checkButton through maxscript but dont seem to be able to. I can press a normal button, but not a checkButton.
For example:
rollout accessTest "access test" ( button one "press" checkbutton two "Check" on one pressed do print "One pressed!" on two changed state do ( if state ==true then (print "check on") else print "check off" ) ) createDialog accessTest
then
RollOutHandle = (windows.getChildHWND 0 "access test" )[1] pressHandle= (windows.getChildHWND RollOutHandle "press") [1] checkHandle =(windows.getChildHWND RollOutHandle "Check") [2] UIAccessor.PressButton pressHandle -- DOES press 'Press' UIAccessor.PressButton checkHandle -- does NOT press 'Check' UIAccessor.PressButtonbyName checkHandle "Check" -- only registers an UNcheck....
I have been trying to figure out the windows.sendMessage stuff but without any progress at all. I cant figure out why this doesn't work..
windows.sendMessage presshandle 0x00F5 0 0
Any help would be much appreciated, Thanks all.
Comments
just usetwo.changed true
just use
accessTest.two.changed true
Youtube, Gumroad
If you have access to the
If you have access to the code of those scripts, that creates the rollouts, then, I think, is easy to create a script taht check/uncheck the buttons in these rollouts. You need to know the name of the rollouts(not the title) and the name of the checkbuttons(not the text that describes them). Then it is very easy to press buttons, enter text in text fields, checking and unchecking checkbuttons, checkboxes, radiobuttons.
Tools and Scripts for Autodesk 3dsMax
Thanks, I'll give it a go.
Thanks, I'll give it a go.
Thats the problem, Im not the
Thats the problem, Im not the creator of the rollouts. They are embedded in the max file I am using, and I didn't want to start messing with code I dont understand, instead I just wanted to replicate how I would use the interface manually and UIaccessor seemed straightforward at first.(Ive got 10 of these rollouts that need unchecking everytime I check one button - so a script seemed like a good idea!).
I guess I may have to figure out a way of accessing the button states via the rollout code rather than the UIAccessor...? Or just lump it and get clicking manually!
Cheers,
If you are a creator of the
If you are a creator of the rollouts then why you want to use UIAccessor? You can get/set state of each checkbottuon. checkbox, radiobutton in the rollout or subrollouts.
Tools and Scripts for Autodesk 3dsMax
Glad to help. :)
Glad to help. :)
Tools and Scripts for Autodesk 3dsMax
Although, I may have spoken
Although, I may have spoken too soon....
It seems it would be far more helpful to be able to set the state of the button to either checked or unchecked, rather than just toggle between. I have a set of rollouts that I want to select which buttons get checked and which dont. I still cant figure out why a windows.sendmessage with 'button checked' doesn't work where as a 'virtual key' press does...?
( local RollOutHandle =
I am sure that there is another way to achieve this. :)
Tools and Scripts for Autodesk 3dsMax
Brilliant, Thanks Miauu !
Brilliant, Thanks Miauu ! Virtual keys, eh! Thanks for the solution ( or 'a' solution if you think there could be other ways - but this one works for me so Im happy!) Cheers!