Capacitance of MOS cap in spice

I'm trying to obtain the CxV curve from moscap in SPICE (hspice).
Note that I'm not talking about the sum of the capacitances from the mos transistor, but the transistor behaving as a capacitor.
Is there an easy way to do this?

Why would there be zero AC current through a capacitor? Set the AC frequency to 100MHz. set the R to a higher value also. Replace the MOSCAP with a Capacitor. Play around with it a bit and figure it out.

Unfortunately, I couldn't replicate this experiment. I don't know what's the problem.
I was able to obtain an estimate of the MOS capacitance with a .op simulation (cgtot parameter), for low frequencies.
The only thing that is missing is the high frequency behavior of the moscap.

sorry
Do a .tran
Then,
Do a .TRAN with a piecewise linear DC source and constant AC source.
I don't use spice much. I'm surprised no one else pointed out the issue. I actually didn't know you can't measure AC during a DC sweep.

The easiest way to do this is with a transient analysis and a pulse so your input should be fine. Remember in the time domain that I = C dV/dT or C = I / (dV/dT). So divide the measured current with the voltage slope and that is your capacitance. You should do it with a rising and falling pulse and average the value you calculate.

AC analysis is also possible and may be more useful if you're using the MOSCAP as a decoupling device (so you mostly care about the capacitance around a small operating region.