Launch Python Script from HM or check value for Theta/MCSID in CQUAD4/CTRIA3 card

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

Hi,

I was wondering if it was possible to launch python script file from HyperMesh.

I mean that I have a .py in /MyDocuments for example.

I would like to launch my macro HM. And then, in this macro, a command that launch my .py in /MyDocuments and continue normally.

 

Or, I would like to check if a value exists for theta/mcsid in CQUAD4/CTRIA3 card. Using 'hm_attributeindexvalue element $element_ID 3 -byid', how to check if a value exists or not ? Because trying this on an element which have no value returns '0'. But '0' could also be a value for theta so...

 

Thanks !

Answers

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

    Why need Python ? Or TCL can't do what you want ?

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

    Hi Cya,

     

    I don't think it is possible to call a python script in HyperMesh. This is should be possible in near future.

     

    Regarding the value, I think the hm_attributeindexvalue element $element_ID 3 -byid will return the index value (say if you referred a local system in MCID it should show the system ID).

     

    I will check and let you know if there a way to return the THETA through command.

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

    If you have pyhton installed, in your tcl script you could:


    exec /path/to/python python.script.py

    and you will execute the python script. But as far as I know, there is no python API in Hyperworks.