T O P I C R E V I E W |
BrOsCoRe |
Posted - 06/28/2015 : 12:20:21 PM Hi Forum,
I wrote a script code that at first import .dat files, then it converts them into a XYZ-Matrix but this code dont convert all importet .dat files, just one. Every .dat File is opened in a new Workbook. After the files where converted to a Matrix i want them all the put in a 3D diagramm and export this graphs into a jpg file. Is there a way somebody could write a code like this or maybe a part of the code. This would be really great because i tried it allready for 7 days.
Greetings from Germany, Bro. |
3 L A T E S T R E P L I E S (Newest First) |
jasonzhao |
Posted - 06/30/2015 : 04:15:08 AM Hello,
You can set your loop by using doc command, for example:
//Execute for all workbooks in the project
doc -e w{xyz_renka 3 20 20;worksheet -p 242 cmap;}
//export all graphs
doc -e p{
expGraph filename:=%H...; }
please refer to this page for further informations.
http://www.originlab.com/doc/LabTalk/ref/Document-cmd#-e_object_.7Bscript.7D.3B_Execute_the_given_script_for_all_objects
Best regards! Jason OriginLab Technical Service
|
BrOsCoRe |
Posted - 06/29/2015 : 11:39:55 AM Version: Origin 8.5.0G SR1
Hi jasonzhao,
I cant send you some Files but i can write down my code for you. I think all you need to know is that the files filled with X,Y and Z coordinates. Code: [Main] win -cd %H; newbook template:=XYZ sheet:=1 optioin:=lsname;
string path$ = "Y:\Daten\Komma";
cd path$; findFiles ext:=B*.dat; impAsc;
xyz_renka 3 20 20; worksheet -p 242 cmap;
expGraph filename:="..." type:=jpg path:="Y:\Daten\Bilder\Komma" tr.Margin:=2 tr1.Unit:=2 tr1.Width:=600 tr2.TIF.DotsPerInch:=300 tr2.TIF.Compression:=LZW;
This code works in the most parts but i dont know how the code convert all imported .dat Files into a Graph and how to name the exportfile like the Worksheet. So if i import 123.dat the exported jjpg file should have the name 123.jpg I thought that it maybe would be better if i load one file, convert it and export it and then load the next. Kind of loop. But there i dont know how to do. If you know please help me and sorry for my bad english :D
Bro.
|
jasonzhao |
Posted - 06/28/2015 : 9:17:55 PM Hello,
You may need to send the .dat file to us to check (e-mail: tech@originlab.com), and what do you mean by XYZ-Matrix, does it mean you have 3 columns and you want to interpolate them into a n*n matrix? Besides, which version of Origin you are using?
Best regards! Jason OriginLab Technical Service |
|
|