A method of modeling a nerve disposed within an intracorporeal treatment area of a patient includes locating an electrode at a plurality of locations within a virtual workspace and providing an electrical stimulus from the electrode to the intracorporeal treatment area. The response of a muscle to the electrical stimulus is monitored and used to determine a distance to the nerve from each of the plurality of locations. A virtual model of the nerve is then constructed within the virtual workspace using the determined distance to the nerve from each of the different positions, and the plurality of locations within the virtual workspace.