def METHOD_NAME(self, obj):
    nextpoint = FreeCAD.Vector()
    if obj.NextObject:
        if obj.NextObject.isDerivedFrom("Path::Feature"):
            # look for the first position of the next path
            for c in obj.NextObject.Path.Commands:
                if c.Name in ["G0", "G00", "G1", "G01", "G2", "G02", "G3", "G03"]:
                    nextpoint = c.Placement.Base
                    break
    # absolute coords, millimeters, cancel offsets
    output = "G90\nG21\nG40\n"
    # go up to the given height
    output += "G0 Z" + str(obj.HopHeight.Value) + "\n"
    # go horizontally to the position of nextpoint
    output += "G0 X" + str(nextpoint.x) + " Y" + str(nextpoint.y) + "\n"
    # print output
    path = Path.Path(output)
    obj.Path = path