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 for Programming
 Forum for Origin C
 Name of matrix page from graph layer?

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
farrow22 Posted - 08/22/2011 : 5:14:32 PM
Origin 8.5.1 SR 2 Windows XP

How does one get the name of the matrix used to plot a graph layer?

In other words, if you right-click on a contour plot, one of the options in the context menu is (for example) "Go to MBook5".

How do I get this information using Origin C?

Thanks,
Roger

3   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 08/23/2011 : 02:37:10 AM
Hi Roger,

If the matrix book contains only one matrix sheet with one matrix object, the line you mentioned can work. Otherwise, it needs to activate the corresponding matrix object of the source matrix sheet, then the code I posted will work in such case.

Penn
farrow22 Posted - 08/23/2011 : 01:29:27 AM
Penn,

thanks very much, your code does the trick.

And to get the name of the matrix page, I found that

string strMatName = dp.GetDatasetName();

seems to work.

Best,
Roger
Penn Posted - 08/22/2011 : 11:49:45 PM
Hi Roger,

Please try the following code, I have added comments for the key lines.

void goToSourceWindow() {
	GraphLayer gl = Project.ActiveLayer();
	if(!gl) {
		out_str("Please Activate A Graph!");
		return;
	}
	DataPlot dp = gl.DataPlots(0);  // get first data plot in layer
	if(!dp) {
		out_str("No Data Plot In Graph Layer!");
		return;
	}

	DataRange dr;
	dp.GetDataRange(dr);  // get data range of the plot
		
	MatrixLayer ml;  // source matrix layer
	int c1, c2;  // matrix object index
	dr.GetRange(ml, c1, c2);  // get the source matrix layer
	
	set_active_layer(ml);  // set the matrix layer active
	ml.SetActive(c1);  // set the matrix object active
}


Penn

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