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
 LabTalk: set column Recalculation Mode to None

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 - 04/30/2020 : 07:41:23 AM
OriginPro 2019b (64-bit) 9.6.5.169
Windows 7 Pro x64 SP1

Greetings!

I want to release a column from the past interp1 X-function, but have an issue with this.
interp1 -r 0 ox:=rTargetColumn;

results in the following error:
quote:
Output not writable, VarName = ox, VarValue = [...]!col(1)


My search delivered the following topics:
https://my.originlab.com/forum/topic.asp?TOPIC_ID=22812 (changing @DAM system variable is not an option)
https://my.originlab.com/forum/topic.asp?TOPIC_ID=20792 (-r 0 option, see above)

What is a proper general way for unlocking columns via LabTalk?

Thank you.
7   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 05/01/2020 : 04:10:19 AM
quote:
Originally posted by cpyang

wks.col.SVRM is for column formula only.

I can't find a Labtalk way to do this, but you can use Origin C. The following code will clear all operations on active worksheet

void clr_op()
{
	Worksheet wks = Project.ActiveLayer();
	vector<uint>	vnUIDs;
	wks.FindIncomingOperations(vnUIDs);
	if(vnUIDs.GetSize() == 0)
		return;
	for(int ii = 0; ii < vnUIDs.GetSize(); ii++) {
		OperationBase& op = Project.GetOperationObject(vnUIDs[ii]);
		if(op) {
			printf("%d: UID(%d), before mode = %d\n", ii+1, vnUIDs[ii], op.GetAutoUpdateMode());
			op.SetAsNone();
		}
		else
			out_str("This should never happen");
	}
}


CP




It works like a charm!
Thank you.
cpyang Posted - 04/30/2020 : 8:38:11 PM
wks.col.SVRM is for column formula only.

I can't find a Labtalk way to do this, but you can use Origin C. The following code will clear all operations on active worksheet

void clr_op()
{
	Worksheet wks = Project.ActiveLayer();
	vector<uint>	vnUIDs;
	wks.FindIncomingOperations(vnUIDs);
	if(vnUIDs.GetSize() == 0)
		return;
	for(int ii = 0; ii < vnUIDs.GetSize(); ii++) {
		OperationBase& op = Project.GetOperationObject(vnUIDs[ii]);
		if(op) {
			printf("%d: UID(%d), before mode = %d\n", ii+1, vnUIDs[ii], op.GetAutoUpdateMode());
			op.SetAsNone();
		}
		else
			out_str("This should never happen");
	}
}


CP
AKazak Posted - 04/30/2020 : 2:44:56 PM
quote:
Originally posted by nick_n

Hi,
I can reproduce it, but I do not know why it happens.
You can try:

interp1 ix:=[Book1]Sheet1!A;
without of -r

The trick: when you call XF from GUI like your: Analysis\Mathematics\Interpolat...\Open dialog -> set desired options and Press triangle and select "Generate script":

and then you will see in Script Window real XF command.
Regards,

Nikolay



interp1 ix:=[Book1]Sheet1!F;


works fine, but appends a new column to the end of the worksheet.
However, it doesn't works if the target column already has a X-function: interp1 or some other , for example smooth. In this case I get the same error:
quote:
Output not writable, VarName = ox, VarValue = [Book1]Sheet1!F


As for calling XF from GUI: the following settings:

generated the following script:
interp1 ix:=[Book1]Sheet1!A iy:=[Book1]Sheet1!(A,B) ox:=[Book1]Sheet1!G"Interpolated Y2";

but this has failed with the same error.
These results show that we cannot remove column lock by overwriting the existing X-function with the same or another with Recalculation Mode set to None.

Here is what I need to do via LT:
nick_n Posted - 04/30/2020 : 2:01:28 PM
Hi,
I can reproduce it, but I do not know why it happens.
You can try:

interp1 ix:=[Book1]Sheet1!A;
without of -r

The trick: when you call XF from GUI like your: Analysis\Mathematics\Interpolat...\Open dialog -> set desired options and Press triangle and select "Generate script":

and then you will see in Script Window real XF command.
Regards,

Nikolay
AKazak Posted - 04/30/2020 : 1:32:05 PM
quote:
Originally posted by nick_n

Hi,

Probably you miss column index, eg:
wks.col2.svrm = 0 //for column 2

Not a direct answer but my advice.
Visit: https://www.originlab.com/FileExchange/ or just press F10 to get some useful apps. For example, I like "Operations manager" for such kind of task.
Regards,

Nikolay



Unfortunately
wks.col3.svrm = 0

doesn't have an effect. I think the reason for this is:
quote:
Set Value Recalculate Mode for the column formula (in any) of the column. 0=none,1=auto,2=manual
.
Therefore it doesn't affect Recalculate Mode of X-functions, such as interp1.

What else can I try?
It seems to be a very easy and basic operation for LabTalk.
nick_n Posted - 04/30/2020 : 1:16:14 PM
Hi,

Probably you miss column index, eg:
wks.col2.svrm = 0 //for column 2

Not direct answer but my advice.
Visit: https://www.originlab.com/FileExchange/ or just press F10 to get some useful apps. For example I like "Operations manager" for such kind task.
Regards,

Nikolay
AKazak Posted - 04/30/2020 : 09:16:56 AM
wks.col.svrm = 0
(https://www.originlab.com/doc/LabTalk/ref/Wks-Col-obj)
also doesn't help.

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