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
 Origin Forum
 Exporting Graphs with LabTalk

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
Jose Posted - 05/12/2000 : 4:19:00 PM
"The export object provides script access for exporting graphs to graphic files", says the Origin 6.0 manual. Following it, I would be able to export the current graph by simply typing


export("c:\windows\test.bmp",BMP);

but it doesn't work in my Patch 3. So I looked in the KnowledgeBase to see some tips, and I found Export graph window in JPEG format using LabTalk commands, that seems to correspond to a previous version of Origin as it is a lot of nonsense, so in doesn't help very much.

Has anyone ever made this object work?

Thanks,

jose.

7   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/04/2000 : 3:12:00 PM
The problem with quotation marks not protecting ',' within a path/filename has been fixed in Origin 6.1.
Jose Posted - 05/16/2000 : 8:43:00 PM
Dear Greg,

you're right, I mistyped the first command. But even if I write it the way it is documented, as you suggest,


export.image("c:\personales\test.bmp",BMP);

I get, after a couple of seconds, the following message,


Page exported to "c:\personales\test.bmp"

but I cannot find that file in that directory or in any other. That is what I
mean with "it doesn't work". It does with the other syntax that I report in the second post of this page.

I have been using the Image.ExportDPI object for successfully exporting JPEG files (this is fast and good enough, and doesn't seem to use the ImageStream filter that I don't like at all), so I'll keep doing it this way as long as it works, even if I don't know very well how it does, ha ha...

Yours,

jose.

[This message has been edited by Jose (edited 05-16-2000).]

greg Posted - 05/16/2000 : 2:04:00 PM
Jose has uncovered a bug, but it's not with the method itself...

The syntax does not require quotation marks around the name. If you delete the two quotation marks from the example above, then it works fine.

So what's the problem?

Starting with Windows 95, the naming rules changed: in addition to allowing Space characters, you can now use Comma in file names as well. Unfortunately, our syntax looks for the comma when parsing the method so it will fail if you try to use a comma in a file name. Until that problem is fixed, avoid commas in filenames.
Wolfgang Kunze Posted - 05/15/2000 : 8:16:00 PM
Dear Jose,
The following script works for me. It opens all the selected origin files in a directory and saves each graph in each selected file as a bitmap, so that you end up with a directroy full of thumnails of your Origin plots. Of course you must first make a subdirectory where
you want to save your bitmap files and you have to edit the 8th line to direct the script to save the files in your directory. You can also edit line 9 to change the resolution of the bitmap files to something other than 250*250 pixels.

getfile -m *.opj;
loop (i,1,count)
{
getfile -get I;
doc -open %A;
doc -e P
{
%S=j:\orgfiles\Thumbs\%G_%H;
save -bs %H %S 250 250;
doc -s;
};
};


Yours
Wolfgang Kunze

Wolfgang Kunze Posted - 05/15/2000 : 8:09:00 PM
Hello. Greg is right. I forgot to add
that I drew a read button in my origin.otp and put the script into the label control to be run on button up. This seems to work fine.
Wolfgang Kunze
greg Posted - 05/15/2000 : 5:15:00 PM
Wolfgang Kunze's solution works in all versions of Origin since 3.5 for bitmap exports. (In 5.0 and 6.0 release the command worked, but produced a "Command Error" message that stopped a script. This could be circumvented by running a standalone OGS section that contained only the command.)

Jose's posts contain a number of errors.

  1. The proper syntax for the export object in 6.0 is documented as:

    export.image(fileName,imageType)

    and will work in any 6.0 version.

  2. The Knowledge Base item referred to documents the older 5.0 mechanism for exporting graphs - which had far fewer graph types than 6.0.
  3. The image object was introduced in the SR2 release of Origin and has not been documented as yet, but works as described in the forum post. The file extensions can be
    • BMP
    • EMF
    • PDF
    • WMF
    • JPG
    • PCX
    • PSD
    • TGA
    • TIF
    • XPM
    • XWD
    • AI
    • CGM
    • DXF
    • EPS
    • PCT
    • PNG


------------------

[This message has been edited by Greg (edited 05-16-2000).]

Jose Posted - 05/12/2000 : 4:29:00 PM
Wait, diving into the File.ogs script I finally found the tip that make me export my graph as a BMP, by commanding


Image.FileName$="C:\windows\test.bmp";
Image.ExportDPI(BMP);

that is a way totally undocumented. Do people at microcal have somewhere to read the proper use of this exporting objects?

Thanks,

jose.


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