Since a lot of my schematics are funky due to this (oh and BTW @Rene_Poschl a similar post worked fine here), I’m wondering if there’s any way to get them back on a coarser grid?
I’m thinking something that would snap all components/wires to the closest grid line. Probably I can script it but would be nice if it already exists.
And yes this is a known problem and a solution is worked on (The true solution at least in my opinion is to have snap to objects instead of relying on grids plus maybe dynamic align tools similar to for example adobe indesign. The former for easily connecting wires to your pins and the later to still have nicely aligned symbols such that the schematic looks good overall even without the need for a grid.)
Are you sure? The fact that nobody openly complained about your wording is not an indication that they were ok with it. To be honest the response by wayne at least seems to indicate that he was at least slightly annoyed (it has a certain tone that i never encountered in any of his other responses).
Alright then, here’s my quick attempt with Python and regex. Seems to work for me but I have about zero prior knowledge of .sch format so it quite likely could shred your files.
import sys
import re
fn = sys.argv[1]
try:
GRID = sys.argv[2]
except:
GRID = 25
def snap(s):
n = int(s.group(1))
if n > 100:
n = round(n / GRID) * GRID
return str(n)
s = open(fn, 'r').read()
s = re.sub('(?<=[ \t])([0-9]+)(?=[ \t\n])', snap, s)
open(fn, 'w').write(s)