How to create a simple loop?
I would like to create a simple loop however I'm not very good in programing... My script is like this but instead of '...' I would like to create a loop which would work till I press return or escape. Is there any simple method?
*createbutton(5, 'Triad', 18, 0, 4, BUTTON, 'Create Triad', 'macroTriad')
*beginmacro(macroTriad) <cr>
*createlistpanel(nodes,1,'Select nodes') <cr>
*createelement(103,1,1,1) <cr>
...
*createlistpanel(nodes,1,'Select nodes') <cr>
*createelement(103,1,1,1) <cr>
*endmacro() <cr>
Kind regards,
Lukasz
Answers
-
Hi,
I don't understand what you want exactly, a simple loop looks like this ...
------------------------------------------------------------------------------
*createmarkpanel elements 1 'Select elements ...'
set element_mark [hm_getmark elements 1]
foreach eid $element_mark {
tk_messageBox -message 'Element : $eid'
}
------------------------------------------------------------------------------
or
------------------------------------------------------------------------------
set stop 0
while {$stop == 0} {
# your code here
set stop 1
}
------------------------------------------------------------------------------
Regards,
Mario
0 -
hello...
i would like to make a script to delete assemblies and sub assemblies in one action... that's need a loop script..please help me
0 -
Hi
Use while loop:
Condition is 'remain emptied assem' use *EntityPreviewEmpty and hm_marklength to check that condition
Body is 'delete them' , use *deletemark
0 -
can you give the full script for me. because i dont know how to make it
0 -
Hi MEIYARASU19
Refer the example script from below link
0 -
If you don't know how to make script I recommend you to learn tcl programming first, not to make tons of questions.
Tcl is easy.
0 -
Altair Forum User said:
If you don't know how to make script I recommend you to learn tcl programming first, not to make tons of questions.
Tcl is easy.
Thank you
0 -
Altair Forum User said:
Hi MEIYARASU19
Refer the example script from below link
Thank you
0