here's a good explanation.

I presume this is for an HEI if it's points then I guess it'd be along the same lines but don't know for certain.
it is quite easy to do. having an old distributor cap that you can cut in half will make it even easier. and
do not turn the engine at all until it's back together.
step 1:
pull off cap with wires still attached. disconnect vacuum line.
step 2:
cut old cap in half about the height of the rotor.
step 3:
mark (#1)distributor body and engine block - use something easily visible and something that won't smudge or move readily then put on the cut cap then mark (#2) the position of the rotor to the cap.
step 4:
after you remove the distributor hold-down lift the distributor slightly and the rotor will turn then stop now mark (#3) this position of the rotor on the cap. then remove distributor. then remove cut cap
step 5:
with the distributor out remove the small roll pin from the shaft that holds the gear in place. be careful and don't lose it unless you have spares and remove the small screws holding the vacuum advance to the distributor body.
step 6:
slide shaft upwards to allow the pickup to slide off the small rod of the vacuum advance then the vacuum advance can be removed and the new one installed.
step 7:
put the gear back onto the shaft and the screws in for the vacuum advance. put cut-cap back on.
step 8:
when you get to putting the distributor back in just line up the rotor to the third mark on the cap and when the distributor is finally seated marks 1 and 2 should be in the right spots. if not then pull it out and re-align until marks 1 and 2 are correct.
step 9:
tighten the hold-down then put the good cap with wires back on and re-attach vacuum line.
step 10: you're done.
see? it's quite easy.

I've heard of some people doing this without removing the distributor but I have no idea how.