According to a typical wiring modality, an empirical method is given for automatically generating the once-through electric wiring diagram for substations. By the extensible definition of typical wiring modality and with the aid of the network analyzing function of Oracle Spatial, the relevant data on substation equipment and connection relationships in the common information model(CIM) are analyzed and matched. Then the wiring diagram can be generated by arranging the positions of the equipments according to the matched wiring diagram.