I have written a CSV file. Now i have to read the file, create nodes at each coordinates, get created node ids.
set dir [tk_chooseDirectory \
-initialdir ~ -title 'Choose a directory']
cd $dir
set fp [open '$dir/Connectors_comp.csv' w+]
*createmark connectors 1 all
set ce_list [ hm_getmark connectors 1];
puts $fp 'connector id,connector coordinates,linked comps id'
foreach CE_L $ce_list {
puts $fp '$CE_L,[hm_ce_getcords $CE_L],[hm_ce_getlinkentities $CE_L comps]'
}
close $fp
set sphereNd {}
eval *createmark nodes 2 displayed
set nids [hm_getmark nodes 2]
*createmark components 1 displayed
set acmtr [hm_getmark components 1]
*displayall
foreach Acmtr $acmtr {
*createmark nodes 1 'by comps' $Acmtr
set nd [hm_getmark nodes 1]
foreach Nd $nd {
set x1 [hm_getentityvalue nodes $Nd 'x' 0]
set y1 [hm_getentityvalue nodes $Nd 'y' 0]
set z1 [hm_getentityvalue nodes $Nd 'z' 0]
puts $x1
*createmark nodes 1 'by sphere' $x1 $y1 $z1 3 inside 0 0 0
set c [hm_getmark nodes 1]
lappend sphereNd $c
}
eval *createmark nodes 1 {*}$sphereNd
set s_nd [hm_getmark nodes 1]
puts $s_nd
eval *createmark nodes 2 {*}$nids
eval *markdifference nodes 1 nodes 2
set E3 [hm_getmark nodes 1]
puts $E3
#create enity sets
*createmark nodes 1 {*}$E3
set st [hm_latestentityid sets 0]
puts &st
set c [hm_getsolverids sets '$st' -byid]
set d [lindex $c 0]
set e [lindex $d 0]
set f [expr $e+1]
set abc 'Set_$f'
*entitysetcreate $abc nodes 1
*createmark sets 2 $abc
set xz [hm_getmark sets 2]
#Check why dictionary loading and note drive name too.
*dictionaryload sets 2 'R:/Altair/14.0/templates/feoutput/ls-dyna971/dyna.key' 'Node'
*attributeupdateint sets $xz 4343 9 2 0 1
*attributeupdateint sets $xz 9001 9 2 0 0
*attributeupdateint sets $xz 90 9 2 0 0
*attributeupdatedouble sets $xz 1901 9 0 0 0
*attributeupdatedouble sets $xz 1902 9 0 0 0
*attributeupdatedouble sets $xz 1903 9 0 0 0
*attributeupdatedouble sets $xz 1904 9 0 0 0
*attributeupdatestring sets $xz 6254 9 2 0 'MECH'
#Create Xtra constarined node set card
set cn [hm_latestentityid constrainedextranodes 0]
set vn [expr $cn+1]
*createentity constrainedextranodes config=102 name='XtraNodes_$vn'
#*setvalue constrainedextranodes id=$vn name=Test_card
#Update Xtra constrained
*setvalue constrainedextranodes id=$vn compid={comps $Acmtr}
*setvalue constrainedextranodes id=$vn entityid={sets $xz}
}