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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 LabTalk: set column Recalculation Mode to None
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1205 Posts

Posted - 04/30/2020 :  07:41:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

AKazak

Russia
1205 Posts

Posted - 04/30/2020 :  09:16:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
wks.col.svrm = 0
(https://www.originlab.com/doc/LabTalk/ref/Wks-Col-obj)
also doesn't help.

Edited by - AKazak on 04/30/2020 09:18:07 AM
Go to Top of Page

nick_n

Finland
125 Posts

Posted - 04/30/2020 :  1:16:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/30/2020 :  1:32:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

nick_n

Finland
125 Posts

Posted - 04/30/2020 :  2:01:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/30/2020 :  2:44:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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:

Edited by - AKazak on 04/30/2020 2:58:22 PM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 04/30/2020 :  8:38:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 05/01/2020 :  04:10:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000