[Eagle HOWTO] GND Vias automated using ULP - with naming workaround

Ever wondered how to evenly spread Vias on a circle, like, so:

.

.

.

Eagle offers a mighty tool for script based automation called ULP. I have looked into it only to automate Vias, but that works very well. I got the info about it here on BLF (forgot which thread) and it worked, although I ran into the same problems with naming all vias in the process.

Here’s a step-by-step howto. I still use Eagle 6.5, so a newer version will look different.

.

.

Using ULP to place vias in a circle with angle-defined spacing

.

.

.

This is what we start with. The board has a center at 20/20, with one test-via in the horizontal we see what size we need and check where they should lie: here I chose 0.4mm via-drill, standard size, 8.1mm distance from the center.

Delete the test-via, then start ULP by clicking the icon (red arrow).

.

.

.

Use “cmd-draw.ulp”

.

.

.

Set “Via” on the left, then “Circle” and “°degree step”

.

.

.

The window changed with each alteration.
Now set X center coord. (20), Y center coord. (20), radius (8.1), Via drill (0.4), leave Via Diameter blank for standard value, set Via shape (Round).
Set Angle start, Angle step and Angle end (here 0 / 20 / 360, so every 20° there will be a via)
Set GND as Signal name.
Note: My grid is in mm, so I use mm values. Adapt your values to your grid.
Press OK

.

.

.

This window shows the script to place the calculated angles. Notice only the first via has a name (‘GND’).
Press OK

.

.

.

And there are Vias. Really good ones.

.

.

.

Workaround for naming all of them GND

Unfortunately only the first Via, the one far to the right, has the name GND. The others are given all different random names (like S$28). I downloaded Eagle 7.4, no change. v7.4 has almost the exact same cmd-draw.ulp script with the same naming result.

I found a workaround by commenting out 2 lines of code.
Copy and save the script under a different name before commenting out, as this workaround might very well disable other functions of the original script.

.

.

.

Open the created file and navigate down (about 85% of the file) until you find the 2 lines with
SigName = “”;
They seem to reset the name after the first via. This might be needed in other functions of the script, but interfere here.
Comment out both lines with a leading // as you see in the picture (the original file does not have the two slashes there).
Save the file and use it instead of the original ulp.

.

.

.

This time all vias get named properly.