I'm not attracted to my husband after he has gained a lot of weight
Do you think that you lost interest just because he gained weight?
We don't have sex much now because of it. I just don't find him attractive.
It's normal to lose interest with someone but it is also normal that people gain or lose weight and people may feel like you're shallow if you're going to let his weight dictate your attractiveness for him. You shouldn't be forced to have sex if you don't want to and if you really are not interested with him anymore, then you should try to talk to him and see if you can divorce him.
I can't force myself to do it.
No one should force you to have sex with him and if you are being forced to do so, I think that will be a sexual harassment case or worse, rape. If you have kids, you should talk with them to prepare them when you guys are eventually going to have a divorce.