T O P I C R E V I E W |
Mike Buess |
Posted - 11/17/2003 : 5:24:37 PM How does one remove a dataplot from a layer in Origin C?
Mike Buess Origin WebRing Member |
4 L A T E S T R E P L I E S (Newest First) |
cpyang |
Posted - 11/17/2003 : 11:34:15 PM 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
|
Mike Buess |
Posted - 11/17/2003 : 8:19:28 PM 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 |
rlewis |
Posted - 11/17/2003 : 7:12:33 PM 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; } |
cpyang |
Posted - 11/17/2003 : 6:00:29 PM 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 |