A medium for recording a part program generator for generating a part program with description of measurement procedures to be used in an image-measuring instrument for measuring a work based on image data obtained by imaging said work, said part program generator comprising the steps of:
- reading work data of said work;
- graphically displaying said work data read at said step of reading;
- selecting a graphic corresponding to an element to be measured in said work among said work data displayed at said step of displaying;
- previously setting measurement conditions containing a generation condition on an edge detection tool applicable to each graphic type;
- and
- generating an edge detection tool corresponding to said each selected graphic based on said measurement conditions set at said step of setting, and generating a part program containing an edge detection command by said generated edge detection tool.