Is it safe to have sex while 35 weeks pregnant?

Many ways 4 loviing. In rare cases it is dangerous, in others desirable, in most ok. Only the woman's OB doctor can determine if it is safe or not in the case of a particular pregnancy. For example, if there has been bleeding or placenta covers or lies near the cervix, if the amniotic sac is leaking fluid, or if there is a risk for preterm birth or pregnancy complications, then it would not be wise to have intercourse.
Yes. As long as there have been no complications in the pregnancy such as bleeding, preterm labor, infection, intercourse is okay up until the day she delivers provided the woman has the energy and desire. Caveat: your semen has prostaglandins in it and she releases prostanglandins with orgasm. Prostaglandins cause smooth muscle to contract. Theoretically, @35 wks, contractions could occur.