There are 3 approaches to control plug-ins in Sonar/CbB:
1) "ACT Dynamic mapping", so with the action sequence:
ACT R1
Direct linear
Then you "ACT Learn" control (with "AZ ACT Fix" utility, that is possible to keep the mapping working)
2) "Direct control", with the action sequence:
Synth (particular name/any) + position + particular parameter
Direct linear
So, particular parameter in particular synth.
3) Allow the controller to be just normal MIDI controller, so Synth can MIDI learn its controls. One button still will be under AZ Controller all the time, to switch the mode. The action list for it:
Ctrl groups, toggle, B
Then in the "Hardware" tab check "B" in "Control group member" for all controls you want to use this way.
So you can combine all 3 methods in one preset. F.e. dynamic for general control of one plug-ins/synth in focus, direct for control several fixed parameters in several plug-ins in parallel, MIDI learning for synths.
With defined "Mode" Software Set with states "Dyn", "Dir", "MIDI":
Mode switching button:
Mode:MIDI Ctrl groups, disable, B
Mode:Dir Ctrl groups, enable, B
Set State "Mode", next, loop.
(note that I first change Ctrl groups and then switch mode, so Action conditions looks contr intuitive)
For other controls:
Mode:Dyn ACT r1
Mode:Dir Synth (particular name/any) + position + particular parameter
Direct linear
And put them into group "B". Note there is no actions for mode "MIDI", AZ Controller will be bypassed in it.