Hotkey - "dynamic" spaced grid

 From:  Paul (AIRGLASS)
509.1 
Hi all,
I worked up a little hotkey script this evening to change grid spacings on the fly that might be useful to some:

PageDown=script:moi.grid.size = (moi.grid.size) / 2; moi.grid.snapSize = moi.grid.size; if (moi.grid.size < 1) {moi.grid.accentedLineFrequency = 1 / (moi.grid.size) } else {moi.grid.accentedLineFrequency = 12 / moi.grid.size};
PageUp=script:moi.grid.size = (moi.grid.size) * 2; moi.grid.snapSize = moi.grid.size; if (moi.grid.size < 1) {moi.grid.accentedLineFrequency = 1 / (moi.grid.size) } else {moi.grid.accentedLineFrequency = 12 / moi.grid.size};

You can also add in the following to turn on grid display and snap at the same time:

moi.grid.display = true; moi.drawingAids.gridSnap = true;

The major grid lines are accented every 1" when the grid spacing is below 1", and accented every 12" when the spacing is above 1".

Metric system users would want to change the values in the 'if' statement to suit themselves-

Now if I could only figure out how to incorporate viewport zoom into it too, I'd be a happy camper!

Paul