Hi,
You should use Gadget Object.
// Execute XF to create gadget on the graph
addtool_curve_intersect trGUI.output.script:=0 trGUI.output.wksName:=[Result]Sheet1;
gadget gg = rect; //Declare LT gadget variable
gg.expand();//expand ROI to full range
gg.output();//output result at current position
More details about the Gadget Object and the addtool_curve_intersect X-Function:
http://www.originlab.com/doc/LabTalk/ref/Gadget-obj
http://www.originlab.com/doc/X-Function/ref/addtool_curve_intersect
Hope it helps.
Regards,
Yuki
OriginLab