This script will create a line to the nearest feature. Example: the input is the feature (polygons) such as property and the nearest feature is the line such as a pipeline. This was created by Nyall Dawson but we have put it here for others to enjoy.