The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 More then one Worksheet to XYZ-Matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

BrOsCoRe

Germany
9 Posts

Posted - 06/28/2015 :  12:20:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

jasonzhao

China
262 Posts

Posted - 06/28/2015 :  9:17:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

BrOsCoRe

Germany
9 Posts

Posted - 06/29/2015 :  11:39:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Edited by - BrOsCoRe on 06/29/2015 1:53:16 PM
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 06/30/2015 :  04:15:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000