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 Python
 How to copy folder from one project to another?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ChemistryGuy

Australia
49 Posts

Posted - 05/22/2023 :  07:30:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2023b (64-bit) Beta2
Operating System: Windows 11

I have two Origin projects, which both contain several folders. Each folder contains graphs and worksheets.

Is it possible to use Python code to copy all folders from one project into the other, thereby combining the two projects? If any could advise me how to do this, I would greatly appreciate it.

ChaoC

USA
178 Posts

Posted - 05/22/2023 :  10:04:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You could use the originpro function lt_exec() to run the LabTalk command for appending project folder.

e.g.

op.lt_exec('doc -afa "C:\Documents\ProjectfileName.opju" "folderName"')

The option -afa: "Appends the contents of the specified folder in another Origin project or all contents in another Origin project to the current folder."

https://docs.originlab.com/originpro/namespaceoriginpro_1_1utils.html#a32f4ba8d0e3bc42d938e25c8be5ec749
https://www.originlab.com/doc/LabTalk/ref/Document_Options_to_Append

Best,
Chao
Go to Top of Page

ChemistryGuy

Australia
49 Posts

Posted - 06/14/2023 :  8:41:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for this advice, I gave it a try and it worked nicely! :)
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