Powder coating and paint-spray lines are often complex production plants because of many dynamical dependencies, limited buffer space and sequence dependent changeover times. We have developed a generic simulation and optimization platform that enables the engineers to design more performant and energy efficient facilities and the production planners to increase productivity through simulation-based optimization. The simulation environment builds on a generic modelling library that captures all variations of such facilities. ‘Executable’ models are generated automatically from annotated CAD layouts. As a result, the system smoothly integrates with the engineering process. Once the facility is in use, the fully specified virtual plant is used for simulation-based scheduling, employing a combination of a generic priority-based heuristic and a variant of simulated annealing. We discuss how these two aspects of the system render it an important innovation for the painting line industry and show first results from the scheduling system.