Jump to content

Recommended Posts


If you just want to write raw data, write it as CSV text format (can be opened by excel)


set fpt [open example.csv w]

puts $fpt "NodeID,StressValue"

puts $fpt [join 1 100]

puts $fpt [join 2 200]

puts $fpt [join 3 300]

close $fpt



==> open example.csv by excel to see

Merula likes this

Share this post

Link to post
Share on other sites

Hi Tinh,


I need to write the data from Hyperview in an organised readable manner.I referred to an example as given below :


  package require twapi
  set excel [::twapi::comobj Excel.Application]
  $excel DisplayAlerts [expr 0]
  set workbooks [$excel Workbooks]
  $workbooks Open "C:/Users/willblatt/BlattBros/Projects/10000 Temp/XLS_Files_Chip/CHIP_ASSAY_TABLE.xlsx"
  set workbook [$workbooks Item 1]
  set sheets [$workbook Sheets]
  set sheet [$sheets Item 1]
  set cells [$sheet range a1 c3]
  puts [$cells Value]
  $cells -destroy
  $sheet -destroy
  $sheets -destroy
  $workbook -destroy
  $workbooks -destroy
  $excel Quit

$excel -destroy


I tried to use the above example.

i.How should I add New Sheet to the file.

ii.Can change the name of the file from Sheet1,Sheet2,etc. to something different say :Normal Force,Axial Force.etc

iii. Any detailed documentation of all the classes available in TWAPI ?


Thanks in advance,


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...