🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Create a TCL Routine for Update a Column table with node of set

User: "Jonny_CAP"
Altair Community Member
Updated by unknown

Hello 

I am writing a tcl script to create a table with the ID node of set:

 

*createstringarray 1 int
*tablecreate "NODE" 1 1 1 1
set table_id [hm_getvalue tables name=NODE dataname=id]

*createmark nodes 1 "by set" 100
set nodes_list [hm_gettablecolumndata $table_id 1]

 

But  is not working.

Can you help me ?

Thank you in advance

Find more posts tagged with

Sort by:
1 - 20 of 201
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    What client are you using?  What is it you are trying to accomplish by putting these node ids in a table?  Not sure this is even possible but the hm_gettablecolumndata (which is replaced by hm_getvalue now) is just querying the column data not setting it and createmark is just putting those nodes on the temporary mark not doing anything with them.

    You would probably want to use *setvalue but in the OptiStuct profile I don't see a way to add a list of nodes to a table.

    Again not sure what you are trying to do but you may want to look into the matrix browser too.

    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown
    I work in NASTRAN MSC profile And I wont write a code tlc just for populate a table automatically and after export .
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    I work in NASTRAN MSC profile And I wont write a code tlc just for populate a table automatically and after export .

    *createstringarray 1 int *tablecreate "pippo" 3 1 1 0 0 *createmark nodes 1 "by set" 160 set nodes_list [hm_getmark nodes 1] *createstringarray 1 $nodes_list *tableaddcolumn "pippo" "nodes" "nodes" 1 1 A new version… but not work … Sincerelly I wont understand if is it possible to do it! I'm not an expert on the subject
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    *createstringarray 1 int *tablecreate "pippo" 3 1 1 0 0 *createmark nodes 1 "by set" 160 set nodes_list [hm_getmark nodes 1] *createstringarray 1 $nodes_list *tableaddcolumn "pippo" "nodes" "nodes" 1 1 A new version… but not work … Sincerelly I wont understand if is it possible to do it! I'm not an expert on the subject

    If you are just trying to export the list of nodes I don't think I would bother with tables I would use matrix browser or something like the following:

    *createmarkpanel nodes 1
    puts [hm_getmark nodes 1]

    or replace the second line with the following if you want them on a different row.

    foreach n [hm_getmark nodes 1] {puts $n}

    You could write them to a text file with open, puts and close commands too.

    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    If you are just trying to export the list of nodes I don't think I would bother with tables I would use matrix browser or something like the following:

    *createmarkpanel nodes 1
    puts [hm_getmark nodes 1]

    or replace the second line with the following if you want them on a different row.

    foreach n [hm_getmark nodes 1] {puts $n}

    You could write them to a text file with open, puts and close commands too.

    I have created a piece of code that does some fem operations and exports elements belonging to the created Sets. now i can't create a rootine which exports nodes id belonging to a set
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    I have created a piece of code that does some fem operations and exports elements belonging to the created Sets. now i can't create a rootine which exports nodes id belonging to a set

    Should work similarly. How are you exporting the elements?

    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    Should work similarly. How are you exporting the elements?

    Yes ! I use Set table id [hm_gettali e tablet name= Xxx dataname=id] Createmark elems 1 $table_id *findattacheddelementfaces 1 $table_id Set elemlist [hm_gettablecolumndata $table_id] But with node is not possible ..
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    Yes ! I use Set table id [hm_gettali e tablet name= Xxx dataname=id] Createmark elems 1 $table_id *findattacheddelementfaces 1 $table_id Set elemlist [hm_gettablecolumndata $table_id] But with node is not possible ..

    Hm_getvalue escuse me
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    Hm_getvalue escuse me

    Export table —-> csv comma delimited
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    Export table —-> csv comma delimited

    What command are you using to export?

    Does the csv look like this:

    123,456,789

    or this:

    123

    456

    789

    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    What command are you using to export?

    Does the csv look like this:

    123,456,789

    or this:

    123

    456

    789

    Tableexport 123 456 789
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    Tableexport 123 456 789

    I hope you understand now what i wont obtain . In this Moment
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    I hope you understand now what i wont obtain . In this Moment

    In this moment i populate only the first fow of my table *createmark nodes1 “By set” x Set node_list[hm_getmark nodes 1] *createstringarray 1 $node_list *tableaddcolumn “x” “nodes” “node” 1 1 I try to popolare All the row… But i don’t know the exact command… i belive i neeed to change stringarray… have idea ?
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    In this moment i populate only the first fow of my table *createmark nodes1 “By set” x Set node_list[hm_getmark nodes 1] *createstringarray 1 $node_list *tableaddcolumn “x” “nodes” “node” 1 1 I try to popolare All the row… But i don’t know the exact command… i belive i neeed to change stringarray… have idea ?

    If you are just trying to get the nodes in a csv file I wouldn't worry about creating a table at all.  I would instead just use tcl commands to export a csv.

    Something like this

    *createmark nodes1 “by set” x

    set fp [open $filename w]
    puts $fp [join [hm_getmark nodes 1] ,]
    close $fp

    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    If you are just trying to get the nodes in a csv file I wouldn't worry about creating a table at all.  I would instead just use tcl commands to export a csv.

    Something like this

    *createmark nodes1 “by set” x

    set fp [open $filename w]
    puts $fp [join [hm_getmark nodes 1] ,]
    close $fp

    what you are doing is excessive! you could better specify the command “puts $ fp [… ..” thank you very much
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    what you are doing is excessive! you could better specify the command “puts $ fp [… ..” thank you very much

    Ahahaha escuse me … what I am doing is excessive! you could better specify the command “puts $ fp [… ..” thank you very much
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    Ahahaha escuse me … what I am doing is excessive! you could better specify the command “puts $ fp [… ..” thank you very much

    is it possible to get a txt file with the data in column?
    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    is it possible to get a txt file with the data in column?

    Please?
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    Please?

    Here is a help page for the puts command:

    https://www.tcl.tk/man/tcl8.5/TclCmd/puts.html

    The open command gets you an i\o stream. Then if you put that stream as the first argument to the puts command it writes to that file instead of to the console. The join command just joins a list with the second argument (in the previous case a comma). You can also use the join with \n which will create a new line for each item in the list.

    Like this:

    *createmark nodes1 “by set” x

    set fp [open $filename w]
    puts $fp [join [hm_getmark nodes 1] \n]
    close $fp

    User: "Jonny_CAP"
    Altair Community Member
    OP
    Updated by unknown

    Here is a help page for the puts command:

    https://www.tcl.tk/man/tcl8.5/TclCmd/puts.html

    The open command gets you an i\o stream. Then if you put that stream as the first argument to the puts command it writes to that file instead of to the console. The join command just joins a list with the second argument (in the previous case a comma). You can also use the join with \n which will create a new line for each item in the list.

    Like this:

    *createmark nodes1 “by set” x

    set fp [open $filename w]
    puts $fp [join [hm_getmark nodes 1] \n]
    close $fp

    thanks for everything ! I was doing many things wrong! a thousand thanks !????