Macroscript checkbutton state on toolbar

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 06 June 2012   #1
Macroscript checkbutton state on toolbar

hi,
I've a problem with an script I'm writing.
I've made an macroscript "myExample" that works fine. There is a checkbutton on the toolbar and as long as the script is running the button is checked. The script stops when I uncheck the button. Thats working fine.

Now, I've made another script (startup) that checks some things in the max file and if it is needed it should run the macroscript "myExample". That´s working fine too,but...

...when I run the macro with this command -macros.run "EGB Scripts" "myExample"- the macro starts but the checkbutton on the toolbar stays unchecked.

If the button were in a rollout it would have a name I could call. But my checkbutton hasn't any...

Is there a way to control the state of this checkbutton?
Thanks!

here the startup script:

function ZE_checken =
(
file = maxFileName
file_Name = getFilenameFile file
ZE_theFileName = maxFilePath + (file_Name + "_ZE.txt")
record_file = openFile ZE_theFileName mode:"r"
close record_file

if record_file == undefined then
(
messagebox "keine Zeit Erfassung Datei!"
)
else
(
rollout ZE_Rollout "dd"
(
button ZE_Start "E"

on ZE_Start pressed do
(
macros.run "EGB Scripts" "ZeitErfassung"
Global isOpen = false
--on isChecked return isOpen
)
)
Ze_Fenster = newRolloutFloater "Scripts" 180 150
addRollout ZE_Rollout Ze_Fenster
)
)
callbacks.removeScripts id:#ZE
callbacks.addscript #filePostOpen "ZE_checken()" id:#ZE
 
Old 06 June 2012   #2
Check out the updateToolbarButtons() function which can be used to update the states of all MacroScripts currently on toolbars.

Also see http://docs.autodesk.com/3DSMAX/14/...488E85F-252.htm
__________________
Bobo
 
Old 06 June 2012   #3
Thanks Bobo, it works fine!
 
Old 06 June 2012   #4
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:08 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.