Setting a Default Value

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

Hey guys,

 

I'm writing a script, where I can set a value (e.g. for the Young's Modulus) for a material property.

My problem is that I would like to have  a default value in the window, like 210000 MPa, which I can take and proceed or change it if it doesn't suit my material. Is it somehow possible to set such a default value?

 

Kind regards and thanks in advance

Simon

 

Attached you can find the part of my script and a screenshot of the window I'm talking about:

*startnotehistorystate {Modified E of material}
set youngs_modulus [hm_getfloat 'Youngs Modulus (Steel)=' 'Enter Youngs Modulus:']
*setvalue mats id=1 STATUS=1 1= $youngs_modulus
*endnotehistorystate {Modified E of material}

 

Default_Value.PNG.61873b4ad688a3e6c30258f6cc548a3c.PNG

Tagged:

Answers

  • vipin_22401
    vipin_22401 Altair Community Member
    edited November 2018

    Hi @Bachelor22

     

    add default value after the string :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

    set youngs_modulus [hm_getfloat 'Youngs Modulus (Steel)=' 'Enter Youngs Modulus:' 210000]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2018

    Thank you @vipin! that helped me a lot.