Press Button by Script
I am able now to press a button via a script.
The only problem is that I don't succeed to click the button I want.
In my example I create a box:
Box lengthsegs:1 widthsegs:1 heightsegs:1 length:20 width:30 height:15 mapcoords:on pos:[0,0,0] isSelected:on
and I run this code in order to hit the "Scale" button in the Motion panel:
( max motion mode maxHWND = windows.getMAXHWND() cmdHWND = for c in windows.getChildrenHWND #max where c == "MotionTask" do exit with c btnHWND = (windows.getChildHWND cmdHWND "Scale") ( UIAccessor.PressButton btnHWND -- press the button ) ) print cmdHWND print btnHWND
The script works. It presses the the "Scale" button of the horizontal button bar of the PRS Parameters of the motion panel.
I want to press another button that has the same name. It is the "Scale" Create Key button situated in the PRS Parameters of the motion panel as well.
Does anyone know how to access these Create Key buttons?
P.S. I know that I can easily create a scale key by using the corresponding maxscript command. I'm asking this as a general question on how to click a button in the 3DSMax GUI.
My real aim is the "Match IK and FK" button of the CAT motion panel parameters for which doesn't seem to exist a maxscript command.
But, as I know that there are a lot of guys who don't like dealing with CAT stuff I try to keep my question as general as possible. :)