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
 Origin Forum
 using a script to save a graph as a bitmap
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a_user

USA
0 Posts

Posted - 08/19/1998 :  2:52:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi. I'm a student working at the University of Toronto physics department, and
i just started using Origin last week. I've been having trouble with the
script command which is used to save graphs as bitmap files, namely

save -bs PlotName FileName Width Height

Actually, the frustrating part is that this command does seem to work, to the
extent that the graph does in fact save properly, but then I get a `Command
Error' message, and thus the rest of the script does not run. I have used this
command all by itself in a script, and have still had the same problem (again,
the graph does save as a bitmap, but I get an error message). Does anyone have
any idea what might be going on?

Thanks for the help.

a_user

USA
0 Posts

Posted - 08/19/1998 :  2:55:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Using a script to save a bitmap

The problem with the save -bs WindowName FileName Width Height was discovered only recently along with a similar problem with the file -c FileName1 FileName2 command.
This is the way to work around the problem until it is fixed:
Create a text file with the following:

[SaveBitmap]
save -bs %1 %2 %3 %4;

[FileCopy]
file -c %1 %2;

and save it with an OGS extension into your Origin directory (such as UTIL.OGS). You can then call this file and pass the various parameters as needed:

run.section(util,SaveBitmap,Graph1 image.bmp 400 300);

and here is the syntax for the new file copy:

run.section(util,FileCopy,c:\origin\origin.ini d:\backup\origin.ini);

This works because the behavior of LabTalk when encountering a Command Error running external scripts is to just exit the script and return and continue whatever script called the external routine.

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