How to get nodes order from element id using TCL

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

Hi,

 

The following problem (written in black) has been resolved, I'm wondering how to get nodes order from element id using TCL.

If you have any trick to do that, I'm interested ! image/emoticons/default_wink.png' alt=';)' srcset='/emoticons/wink@2x.png 2x' width='20' height='20'>

 

I have a problem about my HyperMesh macro.
I would like to get the material orientation of an element but I don't find any information about this.
The only thing that I found is reviewing the orientation but as fast as you leave the menu, the 'vector' disappears and you can't use it.

 Do you have any ideas to help me ?
 

Moreover, I wondered how to get some information in an external file. Is there any functions to do that ?

Thanks in advance.

Regards,

Cya.

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2013

    Have you tried hm_attributeindexvalue on you element ?

     

    To read external information, indeed you can do it easily with Tcl.

    The info you are looking for might be in this page :http://www2.lib.uchicago.edu/keith/tcl-course/topics/tcl-files.html

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2013

    Thanks for your help !

     

    However, with this function, you need the attribute_index of the element, but I don't know which index match with wich attribute. I'm trying to find out this information.

    I'll also take a look to your link about reading external information, thank you. image/emoticons/default_wink.png' alt=';)' srcset='/emoticons/wink@2x.png 2x' width='20' height='20'>

     

    Edit: With the index 3, it seems to return the angle orientation. Now, I'm just wondering how this angle is defined exactly in HyperMesh.

    Edit2: It's the angle between x_elem and x_mat. But I need x_elem vector to know the x_mat ! I am wondering now how to get node1/node2 of the element (defining x_elem) with TCL. We can access to the information thanks to Card Edit in HyperMesh but it seems that I can't extract their ID. :/
    Edit3: Problem solved, got their IDs. image/emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>

  • tinh
    tinh Altair Community Member
    edited November 2013

    hi,

    are you using optistruct solver?

    if so, please refer to attribs defined in feoutput template

    you will find 'THETA' and corresponding attribute name

    you will use attribute name instead of attribute index, because sometimes the index changed (i don't know why)

    then you can get the material direction by

    hm_getentityvalue elems $ELEMID {attribute-name} 0 -byid

     

    there are many attribs defined in template, so to find exact the name, you should open card editor of elems, looking for the text that describe material angle

    then search that text in output template, usually attribute name is not same as the text in card editor

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2013

    Hi,


    Thanks for your help !

    But as my third edit said, I solved the problem using :

     

    hm_getentityvalue element $element_id node1.id 0

    hm_getentityvalue element $element_id node2.id 0

     

    Thanks again !