I'm looking to make a script in CAD which will return a National Grid Reference from and input Postcode
For example User input: AL1 1BY Returns: TL 14584 06989
I've got a CSV from OS "CodePoint - Open" which supplies the Postcode, Easting, Northing, Lat & Long which can be used to grab part of the grid reference, but getting the first 2 letter "TL" is the main issue as the csv doesn't provide this and I'm not sure on how this is calculated.
I've thought about making multiple CSVs (AL.csv, DN.csv, SL.csv...) with the postcodes in linking the Grid Reference to for example
AL.csv
AL1 1BY TL 14584 06989
AL1 1DQ TL 14524 06737
But would this cause issues with speed reading upwards of 10,000+ lines?
I've also wondered if its possible to implement an API call with AutoLisp to use a postcode to NGR code but this isn't something I've done before or know if its possible?
I haven't put anything into place because I'm struggling to think what the best way to implement this would be.