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
 Origin Forum
 Set as X by script

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
jpmat Posted - 05/30/2011 : 06:30:39 AM
Hello,
I checked nearly everywhere, but I cannot find the proper script command to do what does "right click on a column -> set as -> X", so that any further plot of columns to the right of that one, would use the selected column as X. The "is X" property is part of the column properties, under the subgroup "options", but neither in the "set" nor in the "wproperties" commands can you set this "is X" out of nowhere (no copying the format from another sheet, I just want to change this precise parameter), as far as I know. Could anyone help me with this please?
Thanks
Jean-Pierre
Origin Ver. 8 and Service Release 0
Operating System: XP pro
4   L A T E S T    R E P L I E S    (Newest First)
nick_n Posted - 10/06/2017 : 4:50:49 PM
Hi,

If I understood you correctly, run that in script window:

int ii;
loop(ii, 1, wks.nCols) {if(wcol(ii)[L]$=="X") wks.col$(ii).type=4;}

It will set type 4(X column) for column if long name is "X". Best,


Nikolay
wbriggs90 Posted - 10/06/2017 : 3:52:52 PM
What if we cannot expect the index to be the same always and wan to change column type based off of long name?
jpmat Posted - 05/30/2011 : 08:09:45 AM
great, I did not look deep enough! Thanks. As a subsidiary question, would you know how to replace "Book1_B" in "layer -i Book1_B" by a variable that would point to the current worksheet instead (thus making the script suitable for automation: everytime you open a new sheet, it could work with no change)? I found a workaround for my "set as X" problem earlier (but your answer is a lot more simple of course), but for this latter problem, I still don't see any...
Thanks again!
minimax Posted - 05/30/2011 : 07:10:27 AM
wks.colN.type=4;	//N refers the Nth column in the worksheet


Basically column properties are accessible in wks.col.

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