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 for Programming
 Forum for Automation Server/COM and LabVIEW
 How to get the active Origin folder's name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

codexplorer

USA
15 Posts

Posted - 02/28/2016 :  5:02:03 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 9.1.0, 64 bit
Operating System: Windows 7

I am trying to get the name of the active folder in the Origin instance that my LabVIEW code is connected to.
The following page: http://www.originlab.com/doc/LabTalk/guide/String-registers lists a number of codes which can be used with the IOApplication Invoke Node to get a few useful objects' names. For instance, the snapshot below shows how to get the name of the folder in which the project is saved (which is not what I am interested in, I am talking about the internal folder structure of the Origin project):



I can't seem to find one that would correspond to what I am looking for.

Edited by - codexplorer on 02/28/2016 5:03:04 PM

cpyang

USA
1406 Posts

Posted - 02/29/2016 :  4:40:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Origin System String Registers do not have one for Active Folder name. You will need to run LabTalk code to call pe_path X-Function to obtain the full path of the current folder and then get the last token. We have an upcoming Origin2016 SR2 that will have this readily available in a string register "%@F" though.

CP
Go to Top of Page

codexplorer

USA
15 Posts

Posted - 03/03/2016 :  9:18:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OK, I'll try that.
Go to Top of Page

codexplorer

USA
15 Posts

Posted - 03/03/2016 :  11:19:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So I tried this:



and got an empty string, whatever folder is active in the Origin project I am communicating with. The script seems to be working fine within Origin.
Note: The glasses+String VI is a utility to cast a Variant to a String.

Edited by - codexplorer on 03/03/2016 11:20:31 PM
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 03/04/2016 :  01:46:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can modify your LabVIEW Block Diagram in this way:



Best regards!
Jason
OriginLab Technical Service
Go to Top of Page

codexplorer

USA
15 Posts

Posted - 03/04/2016 :  12:07:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, this worked fine.
For those who wonder, the first invoke node is the "execute" method, and the second, "LTStr(get)".
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