progress bar + fileIn
Hello!
I run a script that has a running time of more than a few seconds and i was thinking to add a progress bar.
It is possible to run the script via fileIn "myscript.ms" with progress bar?
rollout test "Testing" width:300 height:100 ( button btn "Run!" progressbar pbar height:30 color:orange label lbl1 "" on btn pressed do ( start = timeStamp() try (filein "myScript.ms") catch(messagebox "Error" beep:false) pbar.value = --> -------------------------------- what should i do here?!?!? if pbar.value > 99 do (pbar.value=0) completeredraw() end = timeStamp() lbl1.caption = " Done in " + (formattedPrint ((end - start) / 10)) + " sec" ) ) createDialog test
Comments
in your filein code you could
in your filein code you could control the pbar by placing the rollout name first like example.
do you mean? if classof test
do you mean?
It won't work.. Can you, please, write an example to understand better what you mean?
Thank you in advance,
-M.
http://mihailupu.ro/
Here's an example. Without
Here's an example. Without your filein code I can't do an exact example.
This should get you started
.
pbar.value = --> -------------------------------- what should i do here?!?!?
You should update the progressBar value using the data from the "myScript.ms". For example, if "myScript.ms" is a loop that counts the selected objects pass the iterations to the pbar and update its value. This way when the loop in "myScript.ms" stops the pbar will be "full".
Tools and Scripts for Autodesk 3dsMax