We are missing a lot of info and honestly I do not quite understand your problem description, so consider
Assuming you need to store the already calculated tool data you can set
TOOL_DATA[<desired tool index>].X = X
TOOL_DATA[<desired tool index>].Y = Y
TOOL_DATA[<desired tool index>].Z = Z
...
and later on call a bas.src function
BAS(#TOOL, <desired tool index>)
from your application. Just study bas.src what it does exactly and it will show you the steps to activate a tool.
Fubini