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
 Forum for Origin C
 Vector XYAM clip data to frame
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

starman2049

USA
15 Posts

Posted - 02/24/2010 :  3:58:42 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am using a Vector/XYAM plot and I want to clip data to frame via program control but don't see how to do that.

I can crate the chart then click on plot details/Display/Data Drawing Options/Clip Data To Frame, but I want to do this via program control not template it.

Any ideas?

Origin Ver. and Service Release (Select Help-->About Origin): 8.1
Operating System: XP

TreeNode

64 Posts

Posted - 02/24/2010 :  7:48:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi starman,

I imagine that this could be done with the methods GetFormat() and SetFormat(),
like in this examples:

http://ocwiki.originlab.com/index.php?title=OriginC:OriginObject-GetFormat

but I didnt find the right property in the Format-Tree... ;-/
I created two Vector Graphs (XYAM). In one of them I activated the property: Clip Data To Frame
Then I stored each Format-Tree in xml-file:


void view_layer_properties_ex1()
{
	Page pg;
	GraphLayer gl;
	Tree tr;
	string strFileName;
	
	foreach (PageBase pb in Project.Pages)
	{
		pg = pb;
		if(!pg)
			continue;
		gl = pg.Layers();
		if(!gl)
			continue;
		strFileName.Format("C:\\XML\\%s.xml", pg.GetName() );
		tr = gl.GetFormat(FPB_ALL, FOB_ALL, true, true);
		tr.Save(strFileName);
	}	
}


I wrote a short C++ program to compare the two xml-files. But it found no difference.
But when I switch "show labels" on/off (checkbox) in one of the GraphPages,
which stands on the same tab ( plotdetails-->Display ), my program finds the difference in the Format-Tree.
So my program works, but couldnt find the property that you want to set via program control... sorry ;-/

I hope someone else knows where to find this property??


|-- TreeNode
...|-- a??
...|-- ha!!
Go to Top of Page

easwar

USA
1964 Posts

Posted - 02/25/2010 :  2:35:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The theme tree does not have this property included in it, so cannot currently use GetFormat and SetFormat

But there is LabTalk script access:

layer -b c 1; // turn on clipping
layer -b c 0; // turn off clipping


So from OC, you can use code such as:

	GraphLayer gly = Project.ActiveLayer();
	gly.LT_execute("layer -b c 1;");


Easwar
OriginLab
Go to Top of Page

starman2049

USA
15 Posts

Posted - 02/25/2010 :  4:38:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks - worked like a charm!!
Go to Top of Page

Deanna

China
Posts

Posted - 03/02/2010 :  01:57:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

We will improve the Theme Tree so that it will include all properties in all graph types. A tracker has been submitted: tr# 15154. Thank you for bringing this up!

Deanna
OriginLab Technical Services
Go to Top of Page

arsk

USA
5 Posts

Posted - 01/22/2011 :  05:34:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hey hi to everyone. It has been long time that there has been any activity over here. Anyway I just want to say my gratitude to those who have posted some wonderful answers over here. You have just saved me. Thanks a lot. I will come here again if I get any doubts.

Hello
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