I have some analog designs I want to make complimentary versions of (nmos swapped with pmos and power rails flipped). Anyone scripted something similar in magic before? I was thinking of flattening the design and then selecting specific layers and replacing them with the complementary version. But magic is alters layers when they overlap and such, so that would be very order sensitive (and might not work at all?). it seems I might just be better off stripping out all the active stuff and only keep my routing, mirror everything, and then instantiate replacement nmos and pmos where the old pmos and nmos were?