The CAD/CAM software UGNX3 was used to implement tool positioning strategy in CNC milling. The Sturz strategy embedded in UG was replaced by curvature matching strategy using the interface of the UG/OPEN API. The feed direction was constrained along u direction of the machined surface. An extra angle was added to eliminate the interference between the cutter and the surface and some additional cutter locations were calculated to ensure the whole face to be machined. After the previous algorithms applied in computer program, an optimized tool path was generated. By the method of ZIG-ZAG mode, the efficiency was increased. The new strategy was verified by the simulation and machining experiment. It showed that combining the new strategy in UG was feasible. The precision and efficiency could thus be improved.