The attached script allows users to back-annotate location assignments for a design. There are wildcards that allow the user to wildcard the node names that get back-annotated and/or the type of location that gets back-annotated. The debug mode(which is on by default) will just dump the location assignments to the command prompt, so the user can dump it into a text file.
I do NOT recommend back-annotating a design. Node names, especially combinatorial node names, change with each synthesis run, so if a user back-annotates their whole design, makes a small change, and then resynthesizes, most of the combinatorial node location assignments will no longer work and the user will get a worse fit. This issue is solved by using Design Partitions for locking down logic, which is the recommended flow.
Where I do find this script to be the most useful is finding the exact name/syntax for locking down a particular type of node. The most common things I've used it for is locking down PLLs or clock trees(clkctrl). I generally run it in debug mode, match the name or type of logic I want to lock down, pipe the results into a file( >> ba_results.txt) and then cut and paste the ones I want into my .qsf