bhagwantP
Ansys Employee

I believe that may not be straightforward easy to do with PyMAPDL:

Resources for your references:

Intro to Rigid Body Dynamics — Lesson 4 - ANSYS Innovation Courses

Dynamic simulation of a printed circuit board assembly — PyMAPDL (pyansys.com)

Thanks