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
 Forum for Python
 Looping through objects (books)

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
AKazak Posted - 09/09/2021 : 11:44:28 AM
OriginPro 2022 (64-bit) Beta2 9.9.0.105
Windows 10 21H1 x64

Greetings!

How do I loop through Origin project objects, such and workbooks, matrix books, notes, etc. using op Python package?

Thank you.

---
Andrey
6   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 09/10/2021 : 1:53:26 PM
quote:
Originally posted by cpyang

quote:

Got it!
Does destroy methods works with all data types of pages, including work and matrix books?

Can I use destroy to delete sheets?

---
Andrey



Thanks!

Yes, destroy is for page and layer(sheet) level.

CP




---
Andrey
cpyang Posted - 09/10/2021 : 08:37:02 AM
quote:

Got it!
Does destroy methods works with all data types of pages, including work and matrix books?

Can I use destroy to delete sheets?

---
Andrey



Yes, destroy is for page and layer(sheet) level.

CP
AKazak Posted - 09/10/2021 : 04:49:15 AM
quote:
Originally posted by cpyang

quote:
Originally posted by AKazak

Thank you.
How do I delete a page?

---
Andrey



Good question, as this was added only recently, so in the latest version of originpro, it is

import originpro as op
wb = op.find_book()
wb.destroy()


CP



Got it!
Does destroy methods works with all data types of pages, including work and matrix books?

Can I use destroy to delete sheets?

---
Andrey
cpyang Posted - 09/10/2021 : 03:57:50 AM
quote:
Originally posted by AKazak

Thank you.
How do I delete a page?

---
Andrey



Good question, as this was added only recently, so in the latest version of originpro, it is

import originpro as op
wb = op.find_book()
wb.destroy()


CP
AKazak Posted - 09/09/2021 : 11:12:36 PM
quote:
Originally posted by YimingChen

You can loop through workbooks('w') matrixbooks('m') or graphs('g') using code below:

for wb in op.pages('w'): 
    print(wb.name)

Currently it doesn't support notes.

James



Dear James,

Thank you.
How do I delete a page?

---
Andrey
YimingChen Posted - 09/09/2021 : 3:15:00 PM
You can loop through workbooks('w') matrixbooks('m') or graphs('g') using code below:

for wb in op.pages('w'): 
    print(wb.name)

Currently it doesn't support notes.

James

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