1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
set script_path [ file dirname [ file normalize [ info script ] ] ] puts $script_path set output_file [file join $script_path "nodes.csv"] set file_id [open $output_file "w"] puts $file_id "node_id,x,y,z" *clearmark nodes 1 *createmarkpanel nodes 1 "Select Nodes" set selected_nodes [hm_getmark nodes 1] if {[llength $selected_nodes] == 0} { puts "Nodes are not selected" close $file_id return } foreach node_id $selected_nodes { set x [hm_getvalue node id=$node_id dataname=x] set y [hm_getvalue node id=$node_id dataname=y] set z [hm_getvalue node id=$node_id dataname=z] puts $file_id "$node_id,$x,$y,$z" } close $file_id *clearmark nodes 1 |
Output:
1 2 3 4 5 6 |
node_id,x,y,z 1,-1.056,0.642667,0 2,-0.778667,-0.322667,0 3,-0.330667,0.0906667,0 4,-1.512,0.122667,0 5,0.696,0.00266667,0 |
Recent Comments