Currently, manual inspection and off-line inspection play an important role in the inspection methods of machining process, which severely restricts the development of inspecting automation. In the paper, automatic programming system for machining center on-line inspection was developed by secondary development kit object ARX of AutoCAD. Inspecting datum was obtained, inspecting process planning was laid up and inspecting program was made automatically. The inspection can be applied to automatic workpiece setting up, on-line inspection of workpiece, data processing, quality analysis and compensation of machined workpiece errors, which led to increase precision, production efficiency and quality and reduced the rate of rejection and tool damage.