TCL script: problem using lists

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

Hello all,

I have a very simple program that I have written which creates 2 nodes in space and then morphs nodes in a model to the newly created nodes sequentially, while holding one of the nodes of the model fixed in place. After I morph the first node I add that node to the fixed nodes to prevent it from moving while I morph the second node, here is my code:

set node_list '{4.49743 16.1122 150.8} {4.56832 7.34812 139.095}'

set target_node 1243503

set moving_node 1002

set fixed_nodes '1001'

foreach node $node_list {

*createnode [lindex $node 0] [lindex $node 1] [lindex $node 2] 0 0 0

*createmark nodes 2 $fixed_nodes

*createlist nodes 1 $target_node

*createlist nodes 2 $moving_node

*morphnodesnodes elements 1 nodes 2 1 2 1 1 3 1.5 1

lappend fixed_nodes $moving_node

incr moving_node

incr target_node

}

The problem that I run into is with the *createmark nodes 2 $fixed_nodes command. For some reason, this command only recognizes the first node in the list and ignores the rest of the list. I have tried adding brackets and parentheses around it and nothing works. Any ideas of how to get this command to recognize the entire list?? Any help would be greatly appreciated. Thanks.

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2011

    instead of '*createmark' use 'hm_createmark'

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

    cesar is right, avoid using *createmark, better go for hm_createmark else use the eval statement before *createmark, i think its time altair deprecated *createmark, causes lot of bugs - cae.developer@gmail.com