The mathematical model of equidistant profile was built.The macro program function of FANUC system was used to develop the macro program for equidistant profile.The program could be used as a canned cycle.When machining equidistant profiles with different edges,the canned cycle could be called directly.The lacks of manual programming and automatic programming are overcome.Program is optimized and programming efficiency is improved.