HM TCL commands

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

Hi,

I am trying to write a HM tcl script to convert LS-Dyna to Nastran/Optistruct format (i.e XtraNode, RigidBody, joint and Tied contact).

If such a tool already exsist please let me know.

I am trying to find answer for the following questions:-

In Dyna template

1) When I use 'hm_getcardimagename group $GroupId -byid' it says group type is 'NodesToSurface'. But how can I find out the contact option eg 'Tied' or 'TiedShell'.

2) How can I get the master and slave set id for conatcts. command 'hm_getentityvalue group $GroupId slavesetlist.id 0 -byid' gives incorect id.

3) How can I run the LsDyna to Nastran convert tool within TCL script.

4) How can I ignore beam 3rd node when using 'hm_createmark nodes 1 'by comp id' $PartId'.

Thanks

Krish

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2010

    have you tried to use the convert tool included in hypermesh? Look for more information in the help (the section name is Conversion between Solver Formats)

    if you have tried using the convert tool, do you get errors in the translation??

    let me know how it work?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2010

    Yes I have tried the convert tool (from the pull down menu). Firstly it does not work if more than 1 section tiles are the same, secondly it does not convert *CONSTRANED_EXTRA_NODE_SET or *CONSTRAINED_RIGID_BODIES or *CONTACT_TIED.. or *CONTACT_SPOTWELD or *CONSTRAINED_JOINT.

    The good news is that the Altair application guys gave me some very very useful tips. Running attribute_table.tcl and entity_attribute_table.tcl you can retrive nearly all information from the hm database.

    So my only outstanding question is how to running the convert tool within a tcl script.

    solution to Q4 is to collect all the beam 3rd nodes manualy.

    Thanks for your intrest.

    Krish

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited May 2011

    the convert tool is an exe which you can run using exec command, for more details mail me cae.developer@gmail.com

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited December 2013

    1) When I use 'hm_getcardimagename group $GroupId -byid' it says group type is 'NodesToSurface'. But how can I find out the contact option eg 'Tied' or 'TiedShell'.

     

    you need to review the attribute values of the contact.  Attributes ContactOption and beamOffsetOption will return the Tied and TiedShell options in the contact.

     

    use the following code to review the attributes for any entity

     

    foreach attr [ hm_attributelist group 'test_00' name ] {

     

                    set attrValue [ hm_attributevalue group 'test_00' $attr  -byname ];

                    puts '$attr $attrValue'

     

    }

    2) How can I get the master and slave set id for conatcts. command 'hm_getentityvalue group $GroupId slavesetlist.id 0 -byid' gives incorect id.

     

    >

     

    set entityId [ hm_getentityarray groups $groupId slavesetlist ] #a list could be returned.

    set setId [ hm_getsolverid set $ entityId ] ;

     

     

     

    set entityId [ hm_getentityarray groups $groupId mastercontactsurflist ]

     

    set contactSurfId [ hm_getsolverid contactsurf $ entityId ] ;

     

     

    3) How can I run the LsDyna to Nastran convert tool within TCL script.

     

     

     

    >  In Hw11, there is a convert API *solverconvert source_solver destination_solver source_type destination_type batch

     

    disclamer, I have not use it.

     

    http://www.altairhyperworks.com/hwhelp/Altair/hw12.0/help/hwdref/_solverconvert.htm

    4) How can I ignore beam 3rd node when using 'hm_createmark nodes 1 'by comp id' $PartId'.

     

    the following should work.

     

    hm_createmark nodes 1 'by comp id' $PartId

    set nodeList [ hm_getmark nodes 1 ];

     

    hm_createmark nodes 1 $nodeList;

    *findmark nodes 1 1 1 elements 0 2;

     

    set elemList [ hm_getmark elems 2];

     

    hm_createmark elems 1 'by config' 'bar2 bar3';

    hm_createmark elems 2 $elemList;

    *markintersection elems 1 elems 2;

     

    set barElems [hm_getmark elems 1];

    set nodeArray [list ];

     

    foreach barId $barElems {

                   

                     set N1 [ hm_getentityvalue elems $barId 'node1.id' 0 -byid ];

                     set N2 [ hm_getentityvalue elems $barId 'node2.id' 0 -byid ];

     

                    lappend nodeArray $N1;

                    lappend nodeArray $N2;

                   

    }