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
 Loading user defined template through 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
achu6393 Posted - 11/18/2016 : 08:37:10 AM
Hello all,

I am trying to create an app and I use a lot of user defined templates for graphing. I have saved the templates in the app folder and packed it as .opx file with the package manager. However, when I install the app in other PC the program fails to load the template to its template library.

Is it possible that I can load these templates to the library using labtalk script? (I can use them in the 'after installation' section)

Thank you.

Origin Ver. 2016 and Service Release 9.3
Operating System: win 7

-Akki

such coding! much wow!
4   L A T E S T    R E P L I E S    (Newest First)
achu6393 Posted - 11/22/2016 : 04:55:33 AM
I want to update my previous reply. I found the function File.exist() which helps in finding if the template is installed or not.
However I couldn't find a function to remove the template from the library.
Is there a labtalk command for the same?

-Akki

such coding! much wow!
achu6393 Posted - 11/21/2016 : 10:32:01 AM
Thank you both for your reply. It worked well.

However, Is there a function which returns whether or not if the specified template already exists in the library? or to delete a template from the library? I donot want to override existing system templates.

Thanks again.

such coding! much wow!
Chris D Posted - 11/18/2016 : 5:00:22 PM
Hi,

A slight improvement to Hideo's response.

There is actually a string register that points to the root folder where Apps are installed (it is %@A ). So his code sample might better be:
//////////////////////////////////////////
window -t plot "%@A\MyAppFolder\myTemplate";  //Open graph template as window. Do not add .OTP extension.
template_saveas pg:=[%H] category:="UserDefined" template:="myTemplate" filepath:="%Y" emf:=1;
//////////////////////////////////////////


Thanks,
Chris Drozdowski
Originlab Technical Support
Hideo Fujii Posted - 11/18/2016 : 4:32:29 PM
Hi Akki,

> Is it possible that I can load these templates to the library using labtalk script?

As you see in the document (http://www.originlab.com/doc/APP/App-Development), App stuffs are
stored in the "AppData\Local" folder for the current Windows user such as:
C:\Users\myName\AppData\Local\OriginLab\Apps\myApp
So, first please make sure if your template files (.OTP and their preview images .EMF) are there.
Then, you can open the template as an empty graph window, and save it as a user defined
template using "template_saveas" x-function. The code maybe like:
//////////////////////////////////////////
%K=C:\Users\myName\AppData\Local\OriginLab\Apps\myAppName\; //App location
window -t plot "%KmyApp";  //open graph window. Do not add .OTP
template_saveas pg:=[%H] category:="UserDefined" template:="myApp" filepath:="%Y" emf:=1;
//////////////////////////////////////////

There might be much better ways, but at least this also works.

--Hideo Fujii
OriginLab

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