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
 Adressing user parameters rows

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
Upcons Posted - 06/24/2025 : 12:00:48 PM
Origin Ver. and Service Release (Select Help-->About Origin): 2025 SR1 Government
Operating System: Windows 11
Originpro package: 1.1.12

Hi,

I got a question and a problem.
1st the question: According to the originpro reference, there is no way to search the names of user parameter rows via python, or am I wrong here? I was only able to find how to cycle through the user parameters via the characters (D1 to D128).
Adressing the user parameters works like a charm with both, the name as well as the character. But I can't figure out how to read the name of the parameter row itself (would be a nice-to-have feature if it isn't implemented yet)


2nd: my problem
I wanted to access a specific user parameter, since I couldn't figure out how to read the names of available user parameters, I went by looping through via character.
And there I noticed something weird, I do have a sheet with 14 user parameters, which are being generated and filled by the import assistent:

Now...this is my corresponding worksheet:


I can adress any of the userparameters via the name, e.g. sampleID, Wavelength.
BUT: I can't access any of the user parameters via character if the number is higher than 9, e.g. D10, D11 etc.

It will return simply nothing. I noticed this, when I looped through the user parameters and it always told me it only found 9 in total, when I had the sheet with 14 on my screen.

FYI: the code I used to loop through:

for i in range(1,128,1):
     a = wks.get_label(0,f"D{i}")
     if a=="":
         continue
     else:
         print(f"i:{i}   {a}")

This code should return 14 lines with my current sheet, but it only does give me 9.
But even if I try to go one by one, I can't access any user parameter above D9. From previous screenshot, D13 is my Wavelength parameter, this is python output I got:

Is this a bug or did I miss a specific setting?

Best regards in advance
2   L A T E S T    R E P L I E S    (Newest First)
Upcons Posted - 07/01/2025 : 08:57:40 AM
Thank you very much YimingChen,

the get_str('userParam#') works fine.

Didn't connect the dots that I could use "userParam" here, for me, the originpro package reference is "slightly" missleading in it's description for the get_str() method. "userParam" is also not inside the originpro reference (via search), did only found it in the the english labtalk book (due to localization, english search results do not show up as standard)

Fingers crossed for the bug fix!
YimingChen Posted - 06/25/2025 : 11:58:03 AM
Hi,

1. You can get the name of the column header row by name = wks.get_str('userParam#'), where # is the index.

2. Then you can access the column label by the code

row_name = wks.get_str('userParam13')
label = wks.get_label(0,row_name)


But it seems like a bug not able to get the column label using character D13. I've reported it (ID: ORG-31589).

Thank you
Yiming

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