active TCL script in two HyperMesh windows

Beta
Beta New Altair Community Member
edited October 2020 in Community Q&A

Hi,

 

I am looking for a solution to make TCL scripts active in two HyperMesh windows simultaneously.

 

Let say I am having two HM windows opening simultaneously, I run a TCL script from a window. This file contains a GUI interface.

 

I expect that when I perform an action on the TCL GUI ( eg: click a button), the command will be executed in both windows

 

Any idea will be very appreciated. Thank you!

 

 

Answers

  • tinh
    tinh Altair Community Member
    edited June 2018

    Hi,

    If HM windows are run on same machine, you just need to load dde package, create dde topics to communicate between the windows

    if HM windows are run on different machines, you need to use socket command.

     

    another 'trivial' method: after performing some actions on window#1, output those commands to a *.tcl file

    (or clipboard)

    and on window#2, set a timer script that scans for the file or clipboard, detects those commands, then performs them

  • Beta
    Beta New Altair Community Member
    edited July 2018

    hi Tinh,

     

    Thank you for your answer,

     

    However, I am not clear about dde package. Could you please recommend a source which I can find more information about this?

     

    Thank you!

  • tinh
    tinh Altair Community Member
    edited July 2018

    The usage is listed in Tcl/tk manual. I found it by google (actually everything about tcl I found by google, too)

  • Beta
    Beta New Altair Community Member
    edited July 2018

    Thank you, this time I tried to add more TCL keyword and found it. 

  • Pandurang
    Pandurang Altair Community Member
    edited July 2018

    Hi,

    If HM windows are run on same machine, you just need to load dde package, create dde topics to communicate between the windows

    if HM windows are run on different machines, you need to use socket command.

     

    another 'trivial' method: after performing some actions on window#1, output those commands to a *.tcl file

    (or clipboard)

    and on window#2, set a timer script that scans for the file or clipboard, detects those commands, then performs them

    dde execute ?-async? service topic data

     

    here what are the supported topic by HM.

     

  • tinh
    tinh Altair Community Member
    edited July 2018

    Hm does not have default topic.

    You have to create topic by command:

    dde servername -handle ...

     

    Handling proc will process data passed by dde execute, you have to define this proc, too