Ordered node set in TCL

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

Hi everyone

I have a macro that I am writing to automate a repetitive task. I have this almost complete, however I am stuck on one thing at the moment.

I am using HM with LS-DYNA.

I have a nodal path which I have used to define an ordered node set (say node ids 25 26 27 10 50 52 60 61). I have verified that the card was generated correctly with the nodes in the correct order.

This set was copied to mark 1 (*createmark nodes 1 ....). Then I used hm_getmark to place the nodes into a tcl list.

However when I reviewed the tcl list, it was sorted from lowest to highest (eg using the above numbers: 10 25 26 27 50 52 60 61).

Any suggestions for getting the original list order into tcl. My code is below:

#=========================

*createmark nodes 1 'by set' set_name

#hm_getmark entity_type mark_id ?panel_sensitive?

set node_Ids [hm_getmark nodes 1]

#=========================

I assume that the problem is that the hm_getmark is the wrong command to use in this case, and this is where the list is sorted.

Thanks for any comments and suggestions.

Regards

Andrew Sims

ResMed

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2011

    Hi,

    assuming you have a pre-existing, ordered node set named 'my_set', you could retrieve the nodes with

    hm_getentityarray sets my_set nodes

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2011

    Thank you Stefan.

    That did the trick. I also was having a look at *createlist, but I found that your suggestion is simpler.

    Thanks again.

    Andrew Sims

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.