Author |
Topic |
|
MbelairB
5 Posts |
Posted - 07/20/2023 : 1:38:59 PM
|
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2021 9.8.0.200 Operating System: Win 10 internal Python: 3.8.3 originpro 1.1.7
Hi, so I am "translating" some of my labtalk scripts to python (easier to develop for me). While I was able to get most things working out of the box, I am struggeling with something stupendiously simple.
I have trouble making a new sheet within an existing workbook. No matter what I do, I only managed to make a new sheet as part of a new book. Unfortunately, I don't find any useful hints in the python documentation beside to mention a lname (which I tried, see MWE). So maybe someone of you has an idea? I also tried wkb.new_sheet, but a workbook apparently doesn't have any new_sheet functions.
My next attempt would be to move the sheet to the other book (although I have no clue so far on how to do it) Best regards
MWE: import originpro as op
# read the current workbook ## this is from my original script wkb = op.find_book() # calculations ## from original script not needed so removed # so this is my attempt in getting the sheet into the existing (and currently being used) book, but it does not work. output = op.new_sheet('w', lname=str(wkb)) |
|
minimax
351 Posts |
Posted - 07/20/2023 : 9:58:43 PM
|
Hi MbelairB,
You can call method add_sheet, like
wkb.add_sheet()
PS, it is supposed there is auto-complete hint on typing python scripts, which should be helpful to see what method is available.
|
|
|
MbelairB
5 Posts |
Posted - 07/24/2023 : 07:18:43 AM
|
Thx minimax.
This was exactly what I was looking for. Unfortunately, I can't use the build in code editor, I only have limited access to the machine that runs origin so I have to develop the script externally. And since I'm very used to VSC, I also don't wanted to adapt to a new tool. I'll however reconfigure my VSC, it is not showing me this method in my tool tips.
But thank you very much. Cya |
|
|
minimax
351 Posts |
Posted - 07/24/2023 : 10:05:09 PM
|
The auto-complete hint should work for any editor in general I suppose.
I just tried Visual Studio Code (v1.80.1), and it seems also showing.
But I am not clear what configuration should be modified.
|
|
|
MbelairB
5 Posts |
Posted - 07/25/2023 : 12:15:28 PM
|
quote: Originally posted by minimax
The auto-complete hint should work for any editor in general I suppose.
Yes, that was what I was expecting as well. Don't know why it wasn't working. I completely resettet my VSC and the plugins and now it seems to be working just fine.
I am using 1.80.1 as well, but with some various plugins (custom highlighting, extended code completetition etc), I guess one of it was blocking the python module viewer for modules that came after their installation.
However, it's working now So, thank you very much again |
|
|
|
Topic |
|
|
|