A method for replacing a portion of a target bone in a living body includes the steps of attaching one or more first markers to a target bone establishing a medical three dimensional representation of the target bone performing a virtual resection of a resection portion the virtual resection constructing a three dimensional representation of the resection portion and a three dimensional representation of the remaining target bone including cutting edges providing a virtual pattern of the resection portion obtaining an implant or graft portion for replacing the resection portion of the target bone by using the virtual pattern of the resection portion resecting the resection portion from the target bone according to the virtual resection using the first reference system of coordinates and coupling the implant or graft portion to the target bone in a position substantially matching a position of the resection portion before the actual resection.