Another solution, no timers and no "dirty" UIAccessor. I used a checkbutton instead of a pickbutton, "outsource" the picking to a function. This way you can call the function from anywhere. I added another button to demonstrate. "mybutton" is optional parameter, so you can imitate the pressed button state. The filter…
Hey folks, could someone please tell me how to activate a maxscript pickbutton via a function? Like, I dont want to start it by having the user click on the button (well, at least not at the time the line of code appears in my script), but rather by a line of code.…
unfortunately this does not work so easily, doesnt throw an error, but neither does it reactivate the button. still i am really greatful for pointing me in the right direction. thank you! i will do some more research after having slept, it's late already! :smile:
Everything works fine, as long as I point it to a normal button. It doesnt work specifically with the pickbutton, though. I dont know what you would need the rest of the code for, as it is not relevant to the problem, I believe? Just imagine a pickbutton, if you select geometry it pops up a window telling you to pick a…
hey peeps, thanks for the responses! the week was hard, so I didnt get a chance to check back here. I avoided the issue by using several pickbuttons, which are hid and unhid by the dropdown selection. I am currently working through your comments to understand them, so thanks for sharing your knowledge! edit: i like your…
I'm not seeing a need to restart the pick code. You can just update the filter based on the dropdown. It even works while you are in pick mode. ( rollout rollPickTest "Pick Test" ( local ddlClass = shape fn PickFilter obj = superclassof obj == ddlClass dropdownlist ddlClassPick "Pick Type" items:#("Shape", "Geometry")…
Ok, I have to excuse, you are right it doesn't work if it's called from within the pickbutton picked function. *Whoops* I guess it's one of those things where you have to use a dirty workaround, in this case a timer. Don't set the timer interval too low or it won't work properly. I call this dirty because timers can be…
You can use the PressButton function in the UIAccesor interface: UIAccessor.PressButton <hwnd> In your case: UIAccessor.PressButton pbtn_pick.hwnd[1] The [1] is needed since .hwnd returns the window pointer in an array.