Press Button by script

Hi,

I've a simple question.

I would like to simply press a button. But something is going wrong.
In my example I try to press the "Select and Move" button by using this line of code:

UIAccessor.PressButtonByName 67616 "Select and Move"

As you can see I used the:

Dialog Window Handle: 67616

But the MAXScriptListner shows a false message for it.
Does anybody know what is wrong?

Comments

Comment viewing options

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

Same here

As "Press Button by Script"... did you find a solution?

miauu's picture

.

The solution is to use UIAccessors and DialogMonitorOps.

ste's picture

Yes I know...

...but I'm quite a noob in scripting.

So i tried to adjust Ewok script (http://www.scriptspot.com/forums/3ds-max/general-scripting/press-button-...) to my needs.

(
   max hierarchy mode
 
   maxHWND = windows.getMAXHWND()
   cmdHWND = for a in windows.getChildrenHWND #max where a[4] == "HierarchyTask" do exit with a[1]
 
   btnHWND = (windows.getChildHWND cmdHWND "Interactive Ik")[1]
   (
      UIAccessor.PressButton btnHWND -- press the button
   )
)
print cmdHWND
print btnHWND

But there is someting wrong because I got no error, the listener returns "OK 66822P 66822P 198868P 198868P" and the command panel switch to hierarchy mode, but nothing else happened.

So where the problem is?

I also tried other solutions here
http://www.scriptspot.com/forums/3ds-max/general-scripting/interactive-i...
but with no luck...

jos's picture

why don't you just use max

why don't you just use
max move?

Ewok's picture

Hi Jos,it's just an example

Hi Jos,

it's just an example to keep the topic as general as possible. :)

In reality I would like to press the "Match IK and FK" button of the CAT menu in the Motion panel. I would like to press this button because I can't find any command for it.

Comment viewing options

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