Jump to content

Read hypermesh status updates when Batch Mesher is operational

Recommended Posts

Is there a way to read what updates are being posted on the Status bar when the batch mesher is run on a particular model ? 


For example I can see various status updates such as "Topology Cleanup : Step 10" and so on, but I want to read those status updates into a variable using a tcl script.


Any help is appreciated. Thank you.

Share this post

Link to post
Share on other sites

@tinh : This is really useful. However I have one concern, when I configure the message_label to my textvariable, it stops storing the updated messages that should be displayed when the batch mesher is run, instead if I change my variable's value only then is the text in the message_label changed on the hm window.


However, I was able to get the current text in the message_label using,

.mainFrame.bottom.message_label cget -text 


Then again, this only gives me the text that is displayed at the time I use this above line, but doesn't keep updating as the text in the label changes.


For example, I want to create a label in my GUI which mirrors the text that is displayed in the message_label always, how could I go about doing that ?


Is there a specific variable that stores the variable in message_label which I can then link my own label's textvariable to ?



Rahul R likes this

Share this post

Link to post
Share on other sites

Hello @jcd


The only way perhaps is to bind .mainFrame.bottom.message_label with a script that will set your variable with its text value

Think that when message text changed, width of message_label will change, too. It will raise a configure event to which we can bind a script. Example

bind .mainFrame.bottom.message_label <Configure> {set your_variable [%W cget -text]}
#create your mirrored label:
toplevel .your_gui
wm transient .your_gui .
pack [label .your_gui.label1 -textvariable your_variable]



jcd and Rahul R like this

Share this post

Link to post
Share on other sites

@tinh : This is brilliant! I did think of binding the message_label text itself whenever it is changed, but wasn't able to find any way to do so. However, I never thought that we could bind it to whenever the width of the message_label is changed. This is exactly what I was looking for.


Thank you !

tinh 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.

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...