This may have been presented here before.......
I designed and built my indoor railroad based on the size rooms that I planned to use. Using Microsoft Paint, I was able to get the layout drawn out to within 1/8" of an inch - 1 pixel equals 1/8".
The following items were purchased; 1/2"x1/2"x10' aluminum angle, 5/8"x3/8"x8' white shelf standards, #8x36" threaded rod, 2" course thread drywall screws, 2 sheets of 5/8" particle board, Flat white latex paint.
Cut the threaded rod into 17" lengths. Cut the shelf standards to lengths of 7", 12" and some to 24". Cut the aluminum angle to match the shelf standards. Drilled #8 holes about 1/2" from each end and in the center of the shelf standards and aluminum rods.
Used a stud finder to locate the ceiling joists. I placed double nuts on the end of every threaded rod and slid them into the holes at each end of the shelf standards. Based on the drawing, I began by measuring the location of each shelf standard. I inserted the 2" drywall screw into the center hole and, using and electric drill, screwed the shelf standards into the pre-drilled hole in the joist until the shelf standard was tight and flush against the ceiling. A piece of aluminum angle was slid onto the loose ends of the threaded rod and another nut was used to secure the angle.
After all of the rail hangars were installed, I cut out the straight and curved sections needed support the track. These pieces of wood were painted white. After the paint dried, the painted wood was set in place. The track was added and screwed into place for stability. Each section of wood was held together with small 1/2" steel plates. Each aluminum angle was secured to the wood from underneath.