Script for moving independent node of Rigids, when changing position of dependent nodes.

Michal Kolatowicz_21221
Michal Kolatowicz_21221 Altair Community Member
edited April 16 in Community Q&A

During my work, I often change the position of the rigids, but moving an independent node usually requires creating a free node in the newly created hole. Could someone help me write a script that would transfer an independent node based on dependent nodes?

I found out commend: 

*rigidlinkupdatecalcinodebycollector

but it change node ID of independent node :(.

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited April 3

    Do you want to recalculate the independent node? If so, unless you want to code the equations yourself, I would just query the id of the independent node, use the api you found, and then renumber the node.

  • Michal Kolatowicz_21221
    Michal Kolatowicz_21221 Altair Community Member
    edited April 4

    Yes. I want to recalculate the independent node. How to query for nodes ids adjacent of rigid element? How to query for independent node of rigid element?

  • Fred_Juras
    Fred_Juras
    Altair Employee
    edited April 4

    You can also use the following API to recalculate independent node position automatically:

    *createmark elements 1 1
    *recalculaterigidmainnode 1

  • Michal Kolatowicz_21221
    Michal Kolatowicz_21221 Altair Community Member
    edited April 4

    Where you found this command "*recalculaterigidmainnode". Im looking for a command: on this page :

    Tcl Modify Commands (altair.com)

    because i cant found this command in this page :(

  • Michal Kolatowicz_21221
    Michal Kolatowicz_21221 Altair Community Member
    edited April 4

    Mine interpreter in HyperMesh 2023 doesnt recognize this commend :"*recalculaterigidmainnode 1" It is correct or how to use it?

     

  • Fred_Juras
    Fred_Juras
    Altair Employee
    edited April 4

    Indeed, this *recalculaterigidmainnode API is not yet documented and available only since v2023.1.
    So with v2023, you should use the *rigidlinkupdatecalcinodebycollector command and then renumber the node.

  • Michal Kolatowicz_21221
    Michal Kolatowicz_21221 Altair Community Member
    edited April 16

    I cant find command which get the nodes connected to rigid body. Anyone can help me with that?

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited April 16

    I cant find command which get the nodes connected to rigid body. Anyone can help me with that?

    This will get you all the nodes from the rigid:

    hm_getvalue elem id=$id dataname=nodes

    This will get you the dependent nodes:

    hm_getvalue elem id=$id dataname=dependentnodes

    And this will get you the independentnode:

    hm_getvalue elem id=$id dataname=independentnode