At my previous job, I declared war on all possible boring processes and automated them as much as I could. Anytime I was caught up, I immediately started coding away our problems. Here are a few.
Text Macros
I noticed I was repeating the same sentence 5 times a day. I used AutoHotKeys so I could paste the sentence with a shortcut. That eventually expanded to about 30 different automated text Macros.
Drill File Correction
Our NC drill files from Gerbers had damaged headers when exporting from our Gerber editor software (Fab3000). I wrote a Python script to correct those headers and used AutoHotKeys to run the Python script instantly.
AutoHotKeys GUI
I had to create a GUI in AutoHotKeys to run our macros since no one could remember them all.
EBOM Analyzer
We ran into a problem where our system required the manufacturer name to be 100% identical to the manufacturer name in our parts database or it took about a minute of work to correct it per MPN. Bla! I created a spreadsheet of “good” manufacturer names. I used Right Click > Send To in Windows to run my Python script that compared the manufacturer names to my “good” manufacturer names spreadsheet. This one script paid for itself 10,000x.
Over time, we found dozens of features to add to the EBOM Analyzer.
- Certain keywords in the parts description indicating additional labor was required ( “screw”, “conformal coating”, etc. ). Finding these keywords saved the company a tremendous number of problems.
- Reference designators were sometimes duplicated. This can’t happen, but it did. The EBOM Analyzer would catch that before it was too late.
- Sometimes reference designators weren’t compatible with our platform. Example. ( ref des C1-3. Does that mean that ref C1, C2, and C3 are required or does it mean that the reference designator is literally “C1-3”? We had to catch that and address it. The EBOM Analyzer made that easy.
Platform Analyzer
Once I gained access to our platform API, I was able to apply the same types of checks used in the EBOM Analyzer to the platform itself.
- Is the stackup of the PCB symmetrical? If not, it’ll probably warp. We checked for that.
- Are there overhanging parts but all 4 sides are v-score? This script checked for that.
The script checked for over 50 things. It was incredible how much time was saved with this script. The number of things that can go wrong on a PCB is truly staggering and this helped catch a ton of them.
Altium Placement To XYRS Conversion
We frequently received placement data from Altium in .txt format. Altium’s placement data is extremely consistent in terms of formatting. It was very easy to identify a placement data file from Altium. Using a single shortcut key, we could convert the Altium placement data to the spreadsheet our system required instantly. A huge time saver!
Enterprise Level? Sharing With My Team
Not quite! When my team expanded from me to 4 of me, I had to adapt all scripts to work on more than just my computer. I started using Github. I created config files so that my team could set the Macros they wanted, use their own API keys, etc.
I learned that Mexico Microsoft Windows has quirks that US Microsoft Windows does not have, particularly with the timing of pasting text using AutoHotKeys. I learned that Microsoft Windows in Missouri has quirks that Windows in Atlanta doesn’t have. I was able to work out these bugs within AutoHotKeys and Python, but working on software for a variety of individuals was a whole new set of problems.
Auto Sorting PCB Files
Part of the job was sorting a customer’s incoming Gerbers, drills, ODB++, EBOM, fab drawing, assembly drawing, nonsense, family photos, napkin drawings, and 50-page lawyer agreements into folders we could make use of. We had to create a folder for the original files and we needed a folder for the edited versions that were cleaned up for our system. It was mind-numbing creating so many folders.
I tried a method were I created the folder structure on my desktop and then just copy and pasted it to the folder of interest. It became confusing. The empty folders seemed to indicate a file was missing. (Missing files can’t happen.) So I scrapped that approach.
I wrote a script where I could use Right Click > Send To and it would create the necessary folder, move the file there, and then create the second folder for edits and make a copy of the file there with a new naming scheme. This saved what feels like decades of pain.
EBOM Spreadsheet – to Spreadsheet Conversion
Someone decided that additional information needed for Row 1 of a spreadsheet would look nicer on Row 2. This violates every law of computer science, basic Microsoft Excel usage, and common decency. Each row is a supposed to be a unique entity and all the information for that row should on that row. Sometimes, Rows 2 through 10 added information to Row 1. It was just madness.
If we had a spreadsheet BOM with 100 unique MPNs, we’d need to manually copy and paste the additional information in Row 2 through Row 10 to the actual row it belonged on. The most common example of this was alternate MPNs.
Manual copy and pasting is time-consuming and dangerous. Humans make mistakes, particularly with mindless, repetitive actions.
I wrote a script that would move the alternates on the “extra” rows up to the row they actually belonged to. This was dangerous. I added numerous fail-safes to be sure that a row wasn’t accidentally moved up to the next row. The row had to be 100% blank except for the information moving up. The same # of blank columns had to exist on every “bad” row before being moved up, etc. This one took real thought.
In the end, I figure this script saved us a few hundred hours of tedious, unpleasant manual work and who knows how many RMAs were avoided.
Auto Creation of Fab3000 Files
Originally, our system often required us to download Gerbers from our platform, make edits, inspection, corrections, and DRC in Fab3000 and then upload the new versions to our platform. This required assigning every Gerber layer (although Fab3000 got better at detecting these….not perfect…but better) but I could not stand setting the blind and buried via settings. It was tedious and nasty….and we already had the information in our platform.
So I went to work generating a script that downloaded all Gerbers and drills along with their specific settings for all blind and buried vias and embedded that into a file that Fab3000 could open. No configuration needed. This saved hours and hours of time and pain over the years.








