Direct Writing Of Three-Dimensional Nanostructures And Their Application In Nanomagnetism