Jump to content
Harish

Work on hypermesh while macro is running in background?

Recommended Posts

Hello,

 

Is it possible to work on hypermesh when we are running a Tcl/Tk script?

 

I would like to use "after 10000" command to halt the execution of the script for some time and I would like to work on hypermesh meanwhile.

 

Thank you.

Share this post


Link to post
Share on other sites

Hi Livil Lyle,  "after 10000" I gave as an example. Actually, I would like the execution of the program to be halted by 30 minutes.

 

Basically, I'm trying to write a "save as" reminder program, which saves the file every 30min in a specified format.

 

 

 

Share this post


Link to post
Share on other sites

Hi Harish

To halt a runnning script, you can use tkwait

Ex:

proc ::p_RunningScript args {

    #a very long time script

    for {set i 0} {$i<1000000000} {incr i}

          Do something...

          if {!($i%1000)} update

          if {$::halt} {

               tkwait variable ::halt

         }

    }

}

 

#before running, indicate halt=0

set ::halt 0

::p_RunningScript

 

#to halt above script, set halt = 1

set ::halt 1

#then call your save as reminder

p_SaveAsReminder

 

#to continue the halt script:

set ::halt 0

 

;)

Livil Lyle likes this

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...