GeoCode is a LISP utility for AutoCAD 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024... (plus Architecture, Civil 3D, Map 3D, MEP) which automatically creates street address for picked points (location) and converts full addresses to lat-long coordinates and geomarkers. The What3Words command variants use the 3-word address code. GeoCode supports the AutoCAD Live Maps. This function uses internet access to Google API and what3words API.
Load this utility with _APPLOAD.
Automatically install GeoCode from Autodesk Apps, or copy the whole "GeoCode.bundle" folder as a subfolder to:
C:\Program Files\Autodesk\ApplicationPluginsor (XP):
C:\Documents and Settings\<usrname>\Application Data\Autodesk\ApplicationPluginsor (Win7/8/10):
C:\Users\<usrname>\AppData\Roaming\Autodesk\ApplicationPlugins-- GeoCode will be loaded automatically (see _APPAUTOLOADER)
Load the GeoCode.VLX with APPLOAD and start the GEOCODE command. Pick a point and GeoCode will display its full street address (or the address of the nearest location). The GEOCODEA command prompts for a full address and returns its lat-long coordinate plus creates a geomarker on this position (with the address as its label). In AutoCAD you need to first set the _GEOGRAPHICLOCATION and your current layer must be ON.
The commands GEOCODEW3 and GEOCODEAW3 use the What3Words service to convert a location to/from a 3-word address code. In Map/Civil you need to first set the coordinate system of your map.
In all commands, you can use the "Keep" option to toggle the address label visibility. Use the command GEOCODEAPIKEYS to set your personal API keys for Google and W3W.
You can also use two LISP interfaces for reverse geocoding (works in any version of AutoCAD) - e.g.:
(revgeocodeLL '(48.9669 14.4768))evaluates to:
"Tylova 153/17, 370 01 Ceske Budejovice, Czech Republic"nonsense coordinates evaluate to:
"ZERO_RESULTS"and:
(revgeocode (getpoint))works like the GEOCODE command, returns the address string.
You can also use a LISP interface function to convert an address to a lat-long point:
(geocodeLL "Tylova 17, Ceske Budejovice")returns a list:
(48.9666 14.4768)And in the What3Words variant - the function:
(revgeocodeLLW3 '(48.9669 14.4768))evaluates to:
"purses.casually.question"while:
(geocodeLLW3 "purses.casually.question")returns a list:
(48.9669 14.4768)If you want to insert the address to your drawing as a label, you can use a block with a attribute (e.g. RotLabel1 from CADforum.cz) and add the following menu macro to your ribbon (make sure the TEXTEVAL variable is set to 1 and ATTDIA to 0):
^C^C(setq p(getpoint"Point:") s(revgeocode p));\_-INSERT;RotLabel1;!p;1;;0;!s;You can also use geocode-debug LISP variable to display debug information:
(setq geocode-debug T)*** IMPORTANT ***
Please note that Google API limits to max. 2,500 requests per 24 hour.
Otherwise you will get the "OVER_QUERY_LIMIT" or "REQUEST_DENIED" results.
Since 2018 you MUST USE your personal API key for any access to Google Maps geocoding API
geocoding - see: https://console.developers.google.com/
You can then use the following parameters to set your personal Google
and W3W API keys and what3word language for GeoCode:
(setq GoogleAPIkey "AaAaAaAaAaAaAaAaAaAaAaAaAaAaA")
(setq w3wAPIkey "12345XYZ")
(setq w3wlang "fr")
Alternatively, you can preset these parameters using the command GEOCODEAPIKEYS (to the Registry).
How to get your personal Google API key? Register on the Google Cloud Platform APIs web site, create a Project and add a Credential:
For your personal W3W API key, go to https://developer.what3words.com
GEOCODE is a free utility by CAD Studio, do not publish it online on other than CADstudio's web servers. Contact CAD Studio for feature enhancements.
Download the free GeoCode application (for AutoCAD 2024-2014)