load data with python

Tecplot's automation language

Python scripts were supported in the alpha version for Legacy 360 (2013). Python inquiries in 2017 should be directed to the PyTecplot Forum.

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

Hans Holzofen
Newbie
Posts: 5
Joined: Wed Dec 19, 2012 7:41 am
Location: Germany

load data with python

Postby Hans Holzofen » Fri Feb 15, 2013 5:18 am

Hi,

I'd like to use python to load data into tecplot.
Usually, I go to
File -- load data files -- tecplot data loader -- select the file (that is in tecplot format)

Hence, I would like to use the function TecUtilReadDataSet.
What happens when I execute a very basic script (see below) is: nothing - no error message occurs, but the data does not occur either.
Essentially, I am using this one command

Code: Select all

results = TecUtil.ReadDataSet(0,True, filename_or_instruction,'TECPLOT',1,True,True,False,True,True,'NULL',0,'NULL','NULL',2,1,1)


Does this look reasonable?
What does the variable

Code: Select all

filename_or_instruction
need to be? A string? Can it be an os.path.join() object?

The documentation says as prerequisite this function needs a frame. But a frame is loaded by default with a new Tecplot document, right?

Do I need to create a new zone first? If yes, then how?

Thanks for your help,

Cheers,
Claus

Svetlana
Expert
Posts: 93
Joined: Sun Dec 22, 2013 3:08 pm
Location: Australia
Contact:

Re: load data with python

Postby Svetlana » Thu Jan 09, 2014 4:41 pm

Yes, a default new document has a frame. TecUtilReadDataSet documentation says the Python data type is a sequence of strings. "16 - 3.1" section of scripting guide says it's a native Python list.


Return to “Tecplot Macro Language”

Who is online

Users browsing this forum: No registered users and 1 guest

cron