Angel Espinoza

The old routine already knew

A long time ago I wrote a set of custom LISP routines for traffic signal design. They worked. They also looked their age: all command line prompts, and no picture of what you were about to get.

Recently I wanted to modernize that workflow into one command and one dialog box. Here is how that went.

What does placing a signal pole involve?

More than it looks like in plan view. A single pole assembly is a dozen or so blocks that depend on each other:

  • The pole itself, at the right height.
  • The mast arm, its signal heads, and maybe a sign.
  • The extras. A pedestrian head, an illuminated street name sign, a luminaire.

Each one has to land at the right offset and rotation. Then comes a loading case, and a standard plan number looked up in a table with more than sixty rows. Then we do it all again at the next approach.

Where was the hard part?

Not in the new code. The old routine already knew the rules. A mast arm sign adds one to the loading case. An illuminated street name sign adds one. Each signal head adds one. Three heads on an arm shorter than 50 feet drops it back by one. A 50 or 55 foot arm goes straight to case 5.

Those rules came from the standard plans, not from me. My job, then and now, was to encode them faithfully. So this was never a redesign. It was a translation, and a translation has one test: same inputs, same plan number as the old routine.

How did it actually get built?

I recreated the original blocks, then told the agent what I wanted the command to do. Then I typed the three words I always type: ask me questions.

The questions were good ones. It recommended layer names I had never bothered to standardize, and it laid out the dialog. There is now a live schematic of the assembly that updates as boxes get checked, before anything touches the drawing.

What else changed?

Two small things that matter more than they sound.

The whole assembly goes in as one step, so one undo takes all of it back. And if the pole block for the chosen height is missing from the drawing, the command stops with a clear message instead of placing half an assembly.

The repetition did not go away. A typical intersection still has four approaches. What went away is the part of each one where the errors used to hide.

Be Better! ...give yourself the green lights.