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
 get embedded graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

couturier

France
291 Posts

Posted - 01/28/2020 :  4:18:43 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):2020
Operating System:win10

I have a graph embedded into a cell, and I want to access this graph to add a plot
Right now, I'm doing something like this:

Worksheet wks = Project.ActiveLayer();
string strCell;
wks.GetCell(nrow, ncol, strCell);
strCell = strCell.GetToken(1,':'); // graph name
GraphLayer gl(strCell, nlay);

But sometimes, I get an invalid GraphLayer
In code builder, strCell will return Graph3 while embedded graph is Graph17 and I can't understand what's going wrong

Is there any better method for accessing an embedded graph ?

couturier

France
291 Posts

Posted - 01/29/2020 :  07:43:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think it's a matter of refresh
when I load the template, only 2 embedded graphs are visibles and code is OK with them
Then I have 5 other graphs than are not visible unless you scroll down, and issue occurs for them
If I scroll down before running the code, everything is OK.

So I'm wondering how to refresh the whole wks

Tried win.SetRedraw(TRUE) + win.UpdateWindow() but it doesn't work
Go to Top of Page

Castiel

343 Posts

Posted - 01/29/2020 :  8:57:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by couturier

I think it's a matter of refresh
when I load the template, only 2 embedded graphs are visibles and code is OK with them
Then I have 5 other graphs than are not visible unless you scroll down, and issue occurs for them
If I scroll down before running the code, everything is OK.

So I'm wondering how to refresh the whole wks

Tried win.SetRedraw(TRUE) + win.UpdateWindow() but it doesn't work




Does Worksheet::GetEmbeddingParams() work?

https://www.originlab.com/doc/OriginC/ref/Worksheet-GetEmbeddingParams


                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
Go to Top of Page

couturier

France
291 Posts

Posted - 01/30/2020 :  06:00:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It works great !
Thanx
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