How to create interactions between macro and user

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi,

 

I would like to update some macros to make them more flexible.

 

For example, I have some tolerance values written directly in the TCL file.
It is better if the user can put the tolerance value when the macro is launched thanks to a dialog box.

I found a way to do that but it needs the command window and I prefer a message like tk_messageBox.

Can I do that ?

Thanks for you help,
Regards.

Answers

  • tinh
    tinh Altair Community Member
    edited September 2014

    Yes, certainly

    you can use function of hm, for example

    set a [hm_getfloat 'input value of a' 'a =']

    or hm_getint, hm_getstring, ...

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2014

    Oh, thanks, that's perfect !

     

    Just another thing in the same mind.

    I have two macros doing the same thing. One for nodes, one for elems.

    Is there a way to open a box saying 'Would you like to play for : Nodes (option 1) - Elems (option 2)'

    In order to have one file instead of two. image/emoticons/default_wink.png' alt=';)' srcset='/emoticons/wink@2x.png 2x' width='20' height='20'>

  • tinh
    tinh Altair Community Member
    edited September 2014

    Sure, there is  image/emoticons/default_biggrin.png' alt=':D' srcset='/emoticons/biggrin@2x.png 2x' width='20' height='20'>

     

    set answer [hwt::Message msgTitle 'Have a good job Cya' msgText 'What would you like to play for?' msgAccept 'Nodes' msgAlt 'Elems' returnButtonText]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2014

    Perfect, thanks ! image/emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2014

    Sorry but I come back, again ! image/emoticons/default_biggrin.png' alt=':D' srcset='/emoticons/biggrin@2x.png 2x' width='20' height='20'>

     

    I tryed this :

     

    hwt::Message msgTitle 'Have a good job Cya' msgText 'What would you like to play for?' msgAccept 'Nodes' msgAlt 'Elems' returnButtonText

     

    But I would like to have :

    Option 1 - Option 2 - Option 3 - ReturnButton

     

    When I just add another 'msgAlt Option3', it removes option 2. :/

    And I don't find the 'help page' of this function.

  • tinh
    tinh Altair Community Member
    edited October 2014

    Hi

    Read help about it in help>Tools>hwGuiToolKit

    you can add 3rd button by 'msgCancel Option3'

    if you need 4 buttons then create a message box your self. it's a modal toplevel

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2014

    Ok perfect, thank you, I'll take a look to that ! image/emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>

     

    Another question about another subject.
    Is there a possibility to run the script without graphic interface update to improve calculation time ?

    Because I guess that show on screen every single action of the script involve a waste of time ?

    Thank you !

  • tinh
    tinh Altair Community Member
    edited October 2014

    Hello,

    to stop update graphic you can set off by *entityhighlighting,  hm_setmouse