Origin Ver. and Service Release: Origin 8 SR6
Operating System: Win XP
Hi,
I want to select data points from a DataPlot. The selected points should be stored in a special data structure.
Before selecting the points it comes up a Dialog. Depending on intention of the user it should be possible to
select a range with the DataSelector (Tool 4) or a single point with DataReader (Tool 3).
Unfortunately there is no direct way to access DataSelector tool from OriginC. So I tried to use Labtalk script, and
called it by function: LT_execute(strScript). To test if it could work this way, I used script example for DoToolbox
command: http://wiki.originlab.com/~originla/ltwiki/index.php?title=LabTalk:DoToolbox_%28command%29
The code from which script is called:
void MyDialog::ClickedOk(TreeNode& tr)
{
string strScript;
bool bRet;
strScript = " dotool 4; def pointproc { py = %C[mks1]; %A = xof(%C); px = %A[mks1]; type -a Left marker is at index $(mks1), X is $(px),Y is $(py); py = %C[mks2]; %A = xof(%C); px = %A[mks2]; type -a Right marker is at index $(mks2), X is $(px),Y is $(py); dotool 0; };";
bRet = LT_execute(strScript);
if(bRet)
out_str("Script executed...");
}
One problem I could figure out, is that execution of the OriginC code is not holded during script execution.
But I need the execution of the OriginC code to be stopped, until user accepted data point by pressing return, so that
pointproc-script is executed. Because after that I want to store these points in my data structure. So after pointproc macro
I need to get the selected points into OriginC variables.
Anyone got an idea? I would be very thankful for help...
|-- TreeNode
...|-- a??
...|-- ha!!