Plotting using TCL
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
(or)
*xyplotmodifycurve 'stress strain' {$firstitems} '' '' '' 1 {$items} '' '' '' 1
*plot
<?xml version="1.0" encoding="UTF-8"?>
yours sincerely,
kartik
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];
}