Abstract This paper describes an automatic part program generator which is a part of a feature-based process planning system. The goal of the described system is to generate automatically reliable NC code from sequenced process plans. Process plans are generated and sequenced by the feature-based process planning system. The part program generator can be tailored by associating parametric part program definitions to the primitive processes of the system, work-elements, which are related to classes of features. These parametric part program definitions are filtered through a code generation algorithm, which produces segments of part program code with relevant coordinate and nominal values. Work-elements are organized as an inheritance hierarchy to enable sharing of common instructions such as tool changes and pallet rotations, and to enable the description of different cutting parameters for tools with different cutting edge materials for which the tool path to be generated remains the same. Generated code segments are glued together to form a complete part or pallet program for part family members. The part program can be interpreted and the tool path visualized either as a whole, work-element by work-element, or instruction by instruction. Visualization provides a fast and relatively reliable test of the correctness of the generated code.