PURPOSE: To shorten a time taken for preparing a program by automatically determining the division of the optimum working range in consideration with the balance of a time taken for working a plurality of spindles.
CONSTITUTION: A dividable point and direction setting section 6 sets dividing points and dividing directions capable of setting a working range to determine the order of employment. Next, the working ranges are sequentially set according to the order of employment from the dividing points and directions to determine the working process of respective spindles and calculate a predetermined working time required for respective working processes. Next, the respective working times are compared with each other and the working time comparing value is judged from the allowable balance value of the working time of input data. Further, the presence of the other dividing points and directions capable of being set is checked. If such processes are repeated and the allowable value is not reached, the optimum dividing method is sought out from the previous process calculation.