That changes your government, but not necessarily your ideology. For example, if the USA got couped in this way, I don't think it would become Fascist, since its ideology lies so heavily towards Democracy.
If you wanted to turn more Fascist or Communist before 1150ing, you might have to go hunting for a major event that doesn't feature minister changes (which might cause problems for any country they weren't designed for). Here are some good events to trigger for 1.06 and CORE 0.84 that move you heavily towards these two poles:
Fascist (1.06 or CORE) - event 2501
Communist (CORE) - event 322037 (You might need to trigger this twice)
I can't find a 1.06 event that moves you heavily toward communism, at least not one that I think you could reliably get away with triggering. Then again, if you're playing as the US, you could simply trigger the written event "The Revolution has come", #3718.
After the coup, I can't guarantee that you'd go fascist or national socialist instead of simply paternal autocrat, or left-wing radical or leninist instead of stalinist. I think that would require going into the savegame file and tweaking it.