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
 Remove data plot?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Mike Buess

USA
3037 Posts

Posted - 11/17/2003 :  5:24:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
How does one remove a dataplot from a layer in Origin C?

Mike Buess
Origin WebRing Member

cpyang

USA
1406 Posts

Posted - 11/17/2003 :  6:00:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am afraid that was missing in 7.5 release and has been added to SR1 (5325).

CP




Edited by - cpyang on 11/17/2003 6:01:06 PM
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 11/17/2003 :  7:12:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Until 7.5-SR1 comes along you may wish to try this workaround which CP posted some time ago ..

bool remove_data_plot(GraphLayer glayer, DataPlot dp)
{
string strName = dp.GetDatasetName();
DataPlot dp1 = glayer.DataPlots(strName);
if(NULL == dp1)
return false; // given data plot does not belong this specified layer
string strTemp;
strTemp.Format("layer -e %s", strName);

glayer.LT_execute(strTemp);
return true;
}
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/17/2003 :  8:19:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Ruthven. That's essentially what I ended up doing.

BTW, you use glayer.LT_execute() in your example. That works fine, but so does just LT_execute(). Are there any guidelines for using one or the other?

Mike Buess
Origin WebRing Member
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 11/17/2003 :  11:34:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
LT_execute gets back into LT and the general problem of Active window and Active Layer. so OC provide page and layer level LT_execute so that the LT string passed into those versions of LT_execute can assume that object as the Active window or Acitve layer. This is very much like the LT version of win -o {script} or layer -o {script}.

It is easy to forget all these little problems and hidden assumptions in the LT world once you are more comfortable with OC, where everything is clear by simply looking at the C/C++ code.

CP


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