ccommand in hypermesh
ccommand in hypermesh
(OP)
hi
I need to use a script in hypermesh that includes a for loop.
could u please tell me how to use a for loop command. i can't find it in the manual
I need to use a script in hypermesh that includes a for loop.
could u please tell me how to use a for loop command. i can't find it in the manual





RE: ccommand in hypermesh
you need TCL to do this.
TCL language manual is not included in the Hyperworks help, but can easily be reviewed e.g. at http://www.tcl.tk/man/tcl8.4/TclCmd/contents.htm
Usually you should rather use foreach to loop over hm entities than a counter with a for statement.
So a loop over all comps is
foreach compID [hm_complist id] {
puts "Another ID: $compID"
}
You can run the script from the GUI by files->run->tcl or
by the right most button of the standard toolbar.
If you need it in batch, you can run hmbatch / hmopengl with "-tcl SCRIPTFILE" (note this inclues a space whereas -cCOMMANDFILE won't).
Regards
Thomas
RE: ccommand in hypermesh
it was helpful
but actually i need to detach all element in my model and it is not possible with using GUI commands.
So i decide to use programming like ansys.
now i can use while and for command but the problem is how to detach elements within a while loop
i wrote these commands and I ran it as u said but *createmark is not tcl command
*******************
set a 1
while {$a<100} {
*createmark(elements,1) $a
*detachelements(1,0)
incr a
}
********************
RE: ccommand in hypermesh
*******************
set a 1
while {$a<100} {
*createmark elements 1 $a
*detachelements 1 0
incr a
}
*******************
Regards,
Ben