According to the idea of manually drawing a train diagram of the express and slow, the different proportions modularization thought of express and slow trains was proposed. Under the condition to satisfy the requirements of trains,the transitions and adjustments between different modules were added to meet the entrance/exit tracks of depot, so that the automatically generated diagram could meet the needs of designers. It can draw different full-day operation plans of different lines in particular proportions. Besides it can convert train diagram into CAD scripts and realize automatic drawing in CAD software. Finally, taking line 18 of Chengdu Metro as an example, the proposed method is implemented and its feasibility is proved.