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 for Programming
 LabTalk Forum
 problems using pointproc
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

wmfry99

2 Posts

Posted - 06/22/2018 :  1:46:15 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2015 64bit sr1 9.2.257
Operating System:win10

hi
i'm having some trouble with pointproc/dotool to get four points from a graph. Specifically, the script below works in a script the first time i run it, but I have to exit origin to get it to work again....

additionally, the type -b command seems to work only sometimes,
i've tried deleting the loose dataset, but that does not solve the issue.

I think the script originally came Originlab support, and was modified.

I'd appreciate some help to figure out the problem.

*******************
count=0;

@global = 1;
dataset dsIndex;
dotool 3;
count = 1;
def pointproc
{
dsIndex[count] = index;
count++;
if(count==5)
dotool 0;
};
def quittoolbox
{
if(count<5)
%o = "PICK POINTS";
type -b %o;

else
{
run.section(a-potassium current.ogs,IA_IVplot);

};
};

yuki_wu

896 Posts

Posted - 06/24/2018 :  10:32:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
I modified your script a litte bit for debugging, but it works fine to me. I am not sure what the issue is, you could tell me more:
	@global = 1;
	dataset dsIndex;
	dotool 3;
	count = 1;  // Initial point
	type "Click to select point, then press Enter";
	type "Press Esc or click on Pointer tool to stop";
	def pointproc
	{
		dsIndex[count] = index;
		count++;
		if(count==5)
		{
			dotool 0;
		}
		else
		{
			type -a Select next point;
		}
		
	}
	
	def quittoolbox
	{
		if(count<5)
		{
			%o = "PICK POINTS";
			type -b %o;
		}
		else
		{
		   for(int ii=1; ii<=count; ii++)
		   {
				type -a $(dsIndex[ii]);
		   }
		}
	}

Regards,
Yuki
OriginLab
Go to Top of Page

wmfry99

2 Posts

Posted - 06/26/2018 :  1:36:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks
The macro behaves a bit better after tidying up, I have it in three locations in the same .ogs file.

Can you explain what the quittoolbox macro defined here accomplishes? I cant seem to find details or other examples.

Thanks!
mark
Go to Top of Page

yuki_wu

896 Posts

Posted - 06/26/2018 :  10:09:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mark,

Please take a look at this page:
https://www.originlab.com/doc/LabTalk/ref/QuitToolbox-macro

Regards,
Yuki
OriginLab
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