Here is something from the manual to keep in mind when using this function.
SwapAxis
Sub SwapAxis(FirstAxis As Integer, SecondAxis As Integer)
This function swaps the STEP and DIR pins for the two specified axes. This has precisely the same effect
as changing the pin settings in Config->Ports&Pins. Note that no other axis parameters or settings are
changed. If the two specified axes have different acceleration and velocity settings, unreliable operation
will likely result. Note also that if you exit Mach3 while the swap is in effect, the swapped pins will be
written to the XML configuration file, and the swap will still be in effect the next time you start Mach3.
It is illegal to perform two consecutive swaps, without first executing a ResetAxisSwap(). Doing so will
likely result in incorrect operation.
ResetAxisSwap
Sub ResetAxisSwap()
This function un-does the effect of a preceding SwapAxis(). Note that this is the only way to undo a
Swap, and it is illegal to perform two SwapAxis() calls without an intervening ResetAxisSwap().