I need to get the ceilings inside each room, using python.
I already have a list with the ceilings and another with the rooms.
I tried to generate the geometry and intersect it but it does not work correctly.
The GetBoundarySegments method of the SpatialElement class (rooms inherit those methods) should do the trick if your rooms are set to have 3d boundaries enabled (which likely they should).
Highly recommend installing clockwork and genius loci (and maybe even crumple). All packages in Python, and they have a heap of reference code, they helped me breakaway from packages as well as eventually author Crumple.