Jump to content

Plotting using TCL

Recommended Posts

Hi ,


I wish to know how to plot a curve from a excel file using TCL. I have currently written a code in this format 



set data1 [read [open "D:\\RWTH\\Mini thesis\\EclipseTCL\\TCL trial\\excelv1.csv"]]
set result1 [regexp -all -inline -line -- {(^.*),.*$} $data1]
set firstitems {}
foreach {tmp item1} $result1 {
  lappend firstitems $item1,
puts "{$firstitems}"



which gives me an output like this (this is the first column to be entered in the curve editor)


{0, 0.0025, 0.005, 0.0075, 0.01, 0.0125, 0.015, 0.0175, ...................75, 0.8, 0.85, 0.9, 0.95, 1,}



Similar to  the above I get the 2nd column.

But how do use TCL and input this data has a curve.



I tried the below specified commands but failed to create plot 


*xyplotcurvemodify "stress strain" {$firstitems} {$items} plot



*xyplotmodifycurve "stress strain" {$firstitems} "" "" "" 1 {$items} "" "" "" 1






yours sincerely,




Share this post

Link to post
Share on other sites

Hi kartik,

Could you please share some screen capture of some sample data in excel and also the required plot in hypermesh. 
You will have to use the below commands to create a plot. 
*xyplotcurvecreate $str_name

*xyplotmodifycurve "$str_name" "{ 0, 0.01 }" "" "" "" 1 "\{ 0.0, 0.001 \}" "" "" "" 1;

*createmark curves 1 $str_name;

  if {[hm_marklength curves 1]} {
            lappend lst_curveids [hm_getmark curves 1];

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...