1. A method for programming of an industrial robot having a robot coordinate system, for an application comprising a tool having a tool coordinate system and a work object to be processed by the tool, wherein the application is programmed by means of a position-measuring unit adapted for measuring positions relative a measuring coordinate system, wherein the method comprises: selecting an object reference structure on or in a fixed relation to the object, the object reference structure having at least one surface, defining a mathematical model for the object reference structure, defining an object coordinate system in a fixed relation to the object reference structure, providing measurements on said at least one surface of the object reference structure, the measurements being performed by the position-measuring unit and are provided relative to the measuring coordinate system, determining the object coordinate system in relation to the measuring coordinate system, by means of best fit between said measurements performed by the position-measuring unit and said mathematical model of the object reference structure, measuring a plurality of positions on a desired robot path on the object by means of the position-measuring unit, determining the positions of the robot path in the object coordinate system, based on said measured positions of the robot path and said determined object coordinate system, determining the relation between the object coordinate system and the robot coordinate system, determining the relation between the tool coordinate system and the robot coordinate system, and programming the robot path based on said positions of the robot path in the object coordinate system, said relation between the object coordinate system and the robot coordinate system, and said relation between the tool coordinate system and the robot coordinate system.