Tool changes And Z Height

@Aiph5u per your last post I was looking at the Bit Setter Macro that @BNB187 wrote and comparing it to yours. I am curious if I wanted to use his bit setter macro and your Tool change routine would they be compatible or the fact that you are using the tool table and he is using gcode user params make it incompatible?

What I am trying to achieve is a tool change using the Rapid Change automatic tool changer. Whether or not folks here like the approach of RC-ATCn it fits my budget and its what I bought, I am trying to get this to work on my BB machine since we now have macros that I thought might help.

So my thought is that I could associate a tool number with a pocket number on the RC-ATC. When the machine hits a M6 it would execute your tool change routine, saving modal states, setting distance, then metric, etc … and then somewhere in there uses the tool number to go to an empty pocket, reverse the direction of the spindle and set it to 700 then lower into the empty pocket, which removes the collet, sets the spindle speed to 0, raises back up to a safe height, moves to the pocket number (a set of XY coords where x remains the same and y is set per the pocket number X set distance ) and sets direction to forward and spindle speed to 700 and down into the new pocket to grab the next collet and tool. Once it has done this I would need to measure the length of the new tool (perhaps using Mike’s bit setter?) and then resume the cut.

Thoughts? How could these two routines be modified/combined to achieve this?