CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > Tecplot

How to open data file in macro

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2015, 13:28
Default How to open data file in macro
  #1
New Member
 
Szymon
Join Date: Jan 2015
Posts: 3
Rep Power: 11
lukas-777 is on a distinguished road
I have to handle many data files and on each file i have to perform similar functions for which i have already written a macro script. The name of the files are in the numerical order like

plunging_i=1_t=2.500e-03.plt , plunging_i=2_t=5.000e-03.plt, plunging_i=3_t=7.500e-03.plt, plunging_i=4_t=1.0000e-03.plt

#!MC 1100
# Created by Tecplot 360 build 12.0.0.3454
$!VarSet |MFBD| = 'C:\Users\Desktop'
$!READDATASET '"D:\DATA\plunging_i=1_t=2.500e-03.plt" '

Is it possible to open these files using macro loop instead of opening each file individually and then executing the same commands ??
lukas-777 is offline   Reply With Quote

Old   January 23, 2015, 17:28
Default
  #2
Senior Member
 
Scott Rumage
Join Date: May 2009
Location: Seattle, WA
Posts: 152
Rep Power: 17
scott_rumage is on a distinguished road
I personally don’t know how to do what you are attempting in Tecplot 360. However this does appear to be a good fit for Tecplot Chorus, i.e. the loading in a series of data files and running a macro to produce a plot for each result.

Another benefit of Chorus is that one then can load in all the resulting plots into a matrix view to compare the results over a range of a given parameter.

You can learn more about Chorus at this link: http://www.tecplot.com/products/tecplot-chorus/

And you can download a trial version of Chorus at this link: http://www.tecplot.com/my/free-trial-software/ .

Regards,
Scott
scott_rumage is offline   Reply With Quote

Old   January 24, 2015, 09:56
Default
  #3
New Member
 
Szymon
Join Date: Jan 2015
Posts: 3
Rep Power: 11
lukas-777 is on a distinguished road
And for Tecplot 360 would do the trick ?? He is working on it.
lukas-777 is offline   Reply With Quote

Old   January 26, 2015, 21:54
Default I would recommend a combination of Python and Tecplot360
  #4
Member
 
Durrell Rittenberg
Join Date: May 2011
Location: Bellevue WA
Posts: 38
Rep Power: 15
Durrell4 is on a distinguished road
Send a message via MSN to Durrell4 Send a message via Yahoo to Durrell4 Send a message via Skype™ to Durrell4
Hi Lukas,

Chorus is perhaps not the tool for your application, I would suggest using python to read the files and launch Tecplot with a macro. If you need help writing the python code let me know and I can send you an example.

Durrell

Here is a script that I use to convert data from plt to szplt if you know python you could follow the code:

import os
import subprocess

tecplotPath = r"C:\Program Files\Tecplot\Tecplot 360 EX Beta\bin\tec360.exe"
directoryToCrawl = r"D:\TEMP\test"

def createWriteSZLMacroFile(filePath):
szlFileName = filePath.replace(".plt", ".szplt")
macroFilePath = r"writeSZL.mcr"
theFile = open(macroFilePath, "w")
theFile.write("#!MC 1410\n")
theFile.write("$!EXTENDEDCOMMAND\n")
theFile.write(" COMMANDPROCESSORID = 'Tecplot Subzone Data Tools'\n")
theFile.write(" COMMAND = 'WRITEDATASET FILENAME=\"%s\"'\n" %(szlFileName))
theFile.close()
return macroFilePath


def convertToSZL(fileName):
macroFilePath = createWriteSZLMacroFile(fileName)
commandArgs = [tecplotPath, fileName, "-b", "-p", macroFilePath]
subprocess.call(commandArgs)
os.unlink(macroFilePath)

def main():
for root, dirs, files in os.walk(directoryToCrawl):
for name in files:
fileName = os.path.join(root,name)
if fileName.endswith(".plt"):
convertToSZL(fileName)

if __name__ == '__main__':
main()
Durrell4 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] difficulties installing swak4foam newbie29 OpenFOAM Community Contributions 120 October 21, 2022 04:01
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57


All times are GMT -4. The time now is 15:42.