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
 LabTalk Forum
 Save folder as project
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LarsVSA6

Germany
3 Posts

Posted - 06/03/2008 :  09:02:06 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5SR6
Operating System:Win2000

Hello,

how can i save a folder from Project Explorer by script automatically?

I start a project with importing a lot of measured data out of excel sheets, make some extractions and calculations and put these new data to new worksheets, then create some folders with pe_mkdir and move only the measured data with pe_move to these folders, while the extracted data remains in the root directory. Unfortunately, the file size of the whole project increases to very high values (about 60MB and more), i want to save the folders and afterwards delete them with pe_rmdir to decrease the size of the project but still keeping the measured data in a different project, so i can have a look at a later time at the measured data in an origin format, if i need. Needless to say doing this with mouse (right click on folder name and save project) it works. I identify the menu -ID for this operation (ID=41012), but using the command menu -e 41012 does not work. So how can i do this, eventually including a button to append again automatically the project with the measured data and after finishing closing/removing the folder again?

Lars

greg

USA
1380 Posts

Posted - 06/10/2008 :  4:51:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You cannot do this from LabTalk, but you can from OriginC so you could make an OC function that is callable from LabTalk with a simple wrapper like this one derived from the example in the Help file for the SaveAsProject method of the Folder class:

#include <Origin.h>

void Folder_SaveAsProject_Ex1(string strPathFileName)
{
Folder fldSave = Project.ActiveFolder();
string strPath = strPathFileName;
bool bOK = fldSave.SaveAsProject(strPath, SFC_INCLUDE_SUBFOLDERS);
out_int("bOK = ", bOK);
}

Create a c file in Code Builder with the above code and build. You can then use

Folder_SaveAsProject_Ex1(D:\My Files\)

The saved project will contain the current folder and subfolders and windows therein.

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