Hi,
I am a new user of tcl/tk and using it for the first time to do some pre-processing in the batch mode. I have currently created a *.cmf file which does all the preprocessing on an optimisation model. While preprocessing, the loads, BC's are all applied in HM (batch mode). The 'Force Load' is applied on a set of nodes stored as 'ndload' in HM and is 5000N. So the nett force on each node will be 5000/number of nodes in 'ndload' set.
I need to extract the number of nodes in this set (coz the number of nodes change as the geometry changes), then do the math (5000/no. of nodes) and finally apply this new force load on the nodes in “ndload” set.
I have put together a few tcl commands as shown below that would probably do this job. But how can I get this tcl file to work when I run my cmf file in the batch mode (these tcl commands would have to be called while running the cmf file).
###############
set num_nodes [llength [hm_getentityarray sets ndload nodes -byname]]
set force [expr [5000 / $num_nodes]]
*createmark nodes 1 'by sets' ndload
eval *loadcreateonentity_curve nodes 1 1 1 0 $force 0 0 0 1 0 0 0 0 0
*createmark loads 1 'by loadcols' force
*attributeupdateentitymark loads 1 45 9 1 0 curves 1
*createmark loads 1 'by loadcols' force
*attributeupdateintmark loads 1 4172 9 2 0 0
###################
I would be grateful if someone could tell me how I can use these tcl commands to work as part of my *.cmf file.
Thanks in advance,
Felix