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
 recalculate not working in script

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
jim67 Posted - 05/08/2014 : 2:02:59 PM
Origin Ver. and Service Release (Select Help-->About Origin): 9.1.0 (32-bit) SR2
Operating System: Windows XP

I've been trying to automate running a number of origin project files that import from a database and create graphs. The data has unstacked columns which are set to Recalculate Mode: Auto. When running manually, all I have to do is load the project file and press the Database Import button and the raw data updates, the unstacked columns update and the graphs update.

To automate this, I created a batch file to run as a windows scheduled task.

The batch file, origin_batch.bat contains
"C:\Program Files\OriginLab\Origin91\Origin9.exe" -r (run.section(Test.OGS,main))

The labtalk script is in Test.OGS (resides in user files folder):
[Main]
doc -o "c:\origin\test.opj";
dbimport;
savepath$ = "c:\origin\test2.opj";
save %(savepath$);
document -s;
exit;

The script runs and creates the test2.opj project file. When I open it, the data has updated, but the unstacked columns tab is not updated and the graphs which are linked to the unstacked columns are not updated. Interestingly, the unstacked columns and the graph both show a green lock icon indicating that they are synched although they are not.

How can I get my script to recalculate the unstacked columns?
7   L A T E S T    R E P L I E S    (Newest First)
jim67 Posted - 08/19/2014 : 10:19:51 AM
The doc -e L {layer -a} script does update the graphs but I want to keep the axes from being rescaled. I've found that only the y-axis is rescaled, so I've modified the script to keep the y-axis scale the same:

doc -e LP
{
yv1=layer.Y.from;
yv2=layer.Y.to;
layer -a;
layer.Y.from=yv1;
layer.Y.to=yv2;
}
jim67 Posted - 08/06/2014 : 2:36:17 PM
Update #2

It turns out that my previous solution doesn't work very often.

I have seemed to solve the problem by adding the following command after the line with "run -p au".

doc -e L {layer -a};

This causes all graphs to update.
jim67 Posted - 06/05/2014 : 11:58:30 AM
Update:

It turns out that the run -p au command did update the unstacked data. I didn't notice this at first because I was looking at the graph to see if it had updated. The graph did not update. Oddly, I found that the graphs would update if I added the export to PowerPoint command to the script. Rather than using the PowerPoint command, using sec -p 2 to add a two second delay also works to get the graphs to update. It looks like it needs a delay for the graph updating to occur.
jim67 Posted - 05/09/2014 : 1:07:41 PM
I tried adding the UID to my script but it still doesn't work.

In my case, run -p aui 803;
Castiel Posted - 05/09/2014 : 11:45:42 AM
quote:
Originally posted by jim67

I assume that the "run -p au;" command would be added to my test.ogs script after the "dbimport" command. I tried that and it had no effect.


You are right. "run -p au;" does not work. But "run -p aui UID;" does.

Edit: Well, it seems "run -p au;" sometimes works....

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
jim67 Posted - 05/09/2014 : 11:02:53 AM
I assume that the "run -p au;" command would be added to my test.ogs script after the "dbimport" command. I tried that and it had no effect.
Castiel Posted - 05/09/2014 : 08:41:45 AM
To force all pending operations to update to completion:
run -p au;

To force a specific pending operation to update to completion:
run -p aui UID;
where UID can be found by clicking the lock and then "Show Info" item. For example, "Analysis(818): freqcounts", then UID=818.

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

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