Closed-Loop Nanopatterning And Characterization Of Polymers With Scanning Probes