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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Multiple images export ?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
stevechang Posted - 03/09/2002 : 05:44:03 AM
I have more than 40 graphs in one project file. I would like to export them at a time.
Currently I can't even export one graph.
I am using scripts like:
image.FileName$="image1.jpg";
image.ShowOptions=0;
image.export.pageDPI(JPG,100);
But it doesn't work. How to revised it?
For multiple images export, what kind of codes should I use?
Any suggetions will be appreciated.

Steve
8   L A T E S T    R E P L I E S    (Newest First)
CStorey Posted - 04/24/2002 : 6:12:39 PM
Hi Steve,

The following works with Origin 6.1 SR4. Origin implemented a new FDLOG function for the purpose of selecting just a directory.

%Z=""; // You could use %Z=some default starting location.
FDLog.DlgName$="Select destination directory for graphs.";
FDLog.ShowComment=1;
FDlog.path$="%Z";

If(FDLog.OpenPath(Z)!=0/0)
{
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
image.FileName$=%Z%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
};
Return;

Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring
rmtruji Posted - 04/24/2002 : 5:19:28 PM
I am wondering if anyone can help me with this issue. I have used the following code to export multiple graphs at one time and it works just great:

*********
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
************
The problem is that I don't want to hardcode the pathname to where I want to put the files. I would like the script to prompt me and ask where I want to put the files. I found the following code for the prompting of saving files:

**************
FDlog.CheckName$=$DialogBox.ExportImage;
FDlog.CheckStatus=Image.ShowOptions;
FDLOG.default$=%H;
FDlog.UseGroup(Image);
Image.GetExtList(z,e);
FDlog.UseType(%z);
if(FDlog.SaveAs(a))
return 1;
Image.ShowOptions=FDlog.CheckStatus;
%z=FDlog.DefTypeExt$;
%B=FDLOG.path$;
Image.FileName$=%b%a;
if(image.IsVector(%Z))`
type -M GraphExportCheckPageSettings;
ImgExperr = Image.Export.PageDPI(%z);
if(ImgExperr > 1) // 1 == user canceled
type -a "Error! Image Export failed, err = $(ImgExperr).";
del -v ImgExperr;
return 0;
*************************
When it prompts, it doesn't allow me to put *.* in the "File Name" section to save all files. It will only save one file at a time. Is there a way to merge these two groups of code so that I can export multiple graphs and have it prompt me to where I want to put them?

Thanks.
rmtruji Posted - 04/24/2002 : 5:17:49 PM
I am wondering if anyone can help me with this issue. I have used the following code to export multiple graphs at one time and it works just great:

*********
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
************
The problem is that I don't want to hardcode the pathname to where I want to put the files. I would like the script to prompt me and ask where I want to put the files. I found the following code for the prompting of saving files:

**************
FDlog.CheckName$=$DialogBox.ExportImage;
FDlog.CheckStatus=Image.ShowOptions;
FDLOG.default$=%H;
FDlog.UseGroup(Image);
Image.GetExtList(z,e);
FDlog.UseType(%z);
if(FDlog.SaveAs(a))
return 1;
Image.ShowOptions=FDlog.CheckStatus;
%z=FDlog.DefTypeExt$;
%B=FDLOG.path$;
Image.FileName$=%b%a;
if(image.IsVector(%Z))`
type -M GraphExportCheckPageSettings;

ImgExperr = Image.Export.PageDPI(%z);
if(ImgExperr > 1) // 1 == user canceled
type -a "Error! Image Export failed, err = $(ImgExperr).";

del -v ImgExperr;
return 0;

*************************
When it prompts, it doesn't allow me to put *.* in the "File Name" section to save all files. It will only save one file at a time. Is there a way to merge these two groups of code so that I can export multiple graphs and have it prompt me to where I want to put them?

Thanks.
rmtruji Posted - 04/24/2002 : 5:16:31 PM
I am wondering if anyone can help me with this issue. I have used the following code to export multiple graphs at one time and it works just great:

*********
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
************

The problem is that I don't want to hardcode the pathname to where I want to put the files. I would like the script to prompt me and ask where I want to put the files. I found the following code for the prompting of saving files:

**************
FDlog.CheckName$=$DialogBox.ExportImage;
FDlog.CheckStatus=Image.ShowOptions;
FDLOG.default$=%H;
FDlog.UseGroup(Image);
Image.GetExtList(z,e);
FDlog.UseType(%z);
if(FDlog.SaveAs(a))
return 1;
Image.ShowOptions=FDlog.CheckStatus;
%z=FDlog.DefTypeExt$;
%B=FDLOG.path$;
Image.FileName$=%b%a;
if(image.IsVector(%Z))`
type -M GraphExportCheckPageSettings;

ImgExperr = Image.Export.PageDPI(%z);
if(ImgExperr > 1) // 1 == user canceled
type -a "Error! Image Export failed, err = $(ImgExperr).";

del -v ImgExperr;
return 0;

*************************

When it prompts, it doesn't allow me to put *.* in the "File Name" section to save all files. It will only save one file at a time. Is there a way to merge these two groups of code so that I can export multiple graphs and have it prompt me to where I want to put them?

Thanks.
rmtruji Posted - 04/24/2002 : 5:15:23 PM
I am wondering if anyone can help me with this issue. I have used the following code to export multiple graphs at one time and it works just great:

*********
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
************

The problem is that I don't want to hardcode the pathname to where I want to put the files. I would like the script to prompt me and ask where I want to put the files. I found the following code for the prompting of saving files:


**************
FDlog.CheckName$=$DialogBox.ExportImage;
FDlog.CheckStatus=Image.ShowOptions;
FDLOG.default$=%H;
FDlog.UseGroup(Image);
Image.GetExtList(z,e);
FDlog.UseType(%z);
if(FDlog.SaveAs(a))
return 1;
Image.ShowOptions=FDlog.CheckStatus;
%z=FDlog.DefTypeExt$;
%B=FDLOG.path$;
Image.FileName$=%b%a;
if(image.IsVector(%Z))`
type -M GraphExportCheckPageSettings;

ImgExperr = Image.Export.PageDPI(%z);
if(ImgExperr > 1) // 1 == user canceled
type -a "Error! Image Export failed, err = $(ImgExperr).";

del -v ImgExperr;
return 0;

*************************

When it prompts, it doesn't allow me to put *.* in the "File Name" section to save all files. It will only save one file at a time. Is there a way to merge these two groups of code so that I can export multiple graphs and have it prompt me to where I want to put them?

Thanks.
stevechang Posted - 03/11/2002 : 8:23:31 PM
Thank you Jose.
I've test your codes and it is great. Now I can export multiple graphs at one time.

*************************************
// Code to export multiple JPG graphs
document -e p {
getnamedwin %h; // activates one graph (%h¡Gactive window title)
run.section(File,Init);
%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.jpg;
image.ShowOptions=0;
image.export.pageDPI(JPG,300,24,2);
}

Steve
Jose Posted - 03/11/2002 : 06:03:30 AM
You can apply your code to all the graphs in a project with a script like

document -e p {

getnamedwin %h; // activates one graph

// your script here, after getnamedwin

run.section(File,Init);
%b="C:\My Documents\My Pictures\";
%m=page.label$;
image.FileName$=%b%m.jpg;
image.ShowOptions=0;
image.export.pageDPI(JPG,300,24,2);
}


I've changed the name of your %h variable to avoid confusions. The help file says for this document command:

quote:

document -e object {script}

Execute the given script for all objects of the specified kind. This command makes an object active and executes the associated script, looping until each object of the specified type has been active. [...]

object=P Execute for all graph windows in the project. %H contains the window name in each iteration.


The getnamedwin command is necessary for certain commands to run properly, but you can test if you can omit it. In that case the code will be faster.


- Jose Viña
Origin WebRing member
stevechang Posted - 03/10/2002 : 8:03:18 PM
I have solved one of my exporting problems, but I still need someone to tell me how to export multiple graphs at one time. THANKS

*******************************
// Code to export one JPG graph
run.section(File,Init);
%b="C:\My Documents\My Pictures\";
%h=page.label$; // Active window title
image.FileName$=%b%h.jpg; // Default name
//type -a %b%h.jpg; //Check exporting path and filename
image.ShowOptions=0; // No Image Export Dialogs
image.export.pageDPI(JPG,300,24,2); // Origin 6.1SR4 Export format.


Steve

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000