We investigate the double-charm and hidden-charm hexaquarks as molecules in the framework of the one-boson-exchange potential model. The multichannel coupling and $S-D$ wave mixing are taken into account carefully. We adopt the complex scaling method to investigate the possible quasibound states, whose widths are from the three-body decay channel $\Lambda_c\Lambda_c\pi$ or $\Lambda_c\bar{\Lambda}_c\pi$. For the double-charm system of $I(J^P)=1(1^+)$, we obtain a quasibound state, whose width is 0.50 MeV if the binding energy is -14.27 MeV. And the $S$-wave $\Lambda_c\Sigma_c$ and $\Lambda_c\Sigma_c^*$ components give the dominant contributions. For the $1(0^+)$ double-charm hexaquark system, we do not find any pole. We find more poles in the hidden-charm hexaquark system. We obtain one pole as a quasibound state in the $I^G(J^{PC})=1^+(0^{--})$ system, which only has one channel $(\Lambda_c\bar{\Sigma}_c+\Sigma_c\bar{\Lambda}_c)/\sqrt{2}$. Its width is 1.72 MeV with a binding energy of -5.37 MeV. But, we do not find any pole for the scalar $1^-(0^{-+})$ system. For the vector $1^-(1^{-+})$ system, we find a quasibound state. Its energies, widths and constituents are very similar to those of the $1(1^+)$ double-charm case. In the vector $1^+(1^{--})$ system, we get two poles -- a quasibound state and a resonance. The quasibound state has a width of 0.6 MeV with a binding energy of -15.37 MeV. For the resonance, its width is 2.72 MeV with an energy of 63.55 MeV relative to the $\Lambda_c\bar{\Sigma}_c$ threshold. And its partial width from the two-body decay channel $(\Lambda_c\bar{\Sigma}_c-\Sigma_c\bar{\Lambda}_c)/\sqrt{2}$ is apparently larger than the partial width from the three-body decay channel $\Lambda_c\bar{\Lambda}_c\pi$.