This is a simple piece of code that will swap out dimmer numbers bewteen two channels. A quick way of correcting small convention patch mistakes.

Select two channels and run the script. I have mine on a bump button.

Right now it only works on channels with one dimmer attached. It might do something with channels that have more than one dimmer but it wont be what you expect. So be careful with this. Two channels and 2 dimmers, thats all.

I LOVE IT I LOVE IT
I've been thinking of adding this to the main code. I asked Flying Pig for this about 15 years ago. Nobody ever thought it was a good idea. SOOOOOooooo often, the guys in the rig mis patch two things.
Very clever Tom.
Everyone should have this one.

--[[Swappatch function
Takes assigned dimmers from one channel and swaps them with another
provided two channels are selected and the script is run,
Current version supports multiple dimmers per channel.
Does not support moving lights.
--]]
function trim(s)
local a1 = (string.gsub(s, "Dimr:", ""))
local a2 = (string.gsub(a1, ",Addr2:", ""))
local a3 = (string.gsub(a2, ",Addr3:", ""))
local a4 = (string.gsub(a3, ",Addr4:", ""))
return(a4)
end
local s = HC.GetCurrentSelectionSet(',')
local a = 0
local c = {}
for fixture in string.gmatch(s,"%d+") do
c[a] = fixture
a = a + 1
end
if a==2 then
local d0=HC.GetProperty('fixture','#'..c[0],'patch')
local d1=HC.GetProperty('fixture','#'..c[1],'patch')
--print(c[0].." - "..trim(d0).." "..c[1].." - "..trim(d1))
--swappatch(c[0],trim(d0),c[1],trim(d1))
local dims0 = {}
local n = 0
for dimmer in string.gmatch(trim(d0),"%d+") do
dims0[n] = dimmer
n=n+1
end
local dims1 = {}
local m = 0
for dimmer in string.gmatch(trim(d1),"%d+") do
dims1[m] = dimmer
m=m+1
end
while m>0 do
HC.PatchFixture(c[0],dims1[m-1])
m = m - 1
end
while n>0 do
HC.PatchFixture(c[1],dims0[n-1])
n = n - 1
end
else
HC.MessageBox('Select 2 fixtures only','Patchswap script')
end

Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.