AutoCAD to Google Earth - Custom AutoLISP Script
Custom AutoLISP Script
DWG to KML Converter
Transform your AutoCAD slope plans directly into Google Earth with GPS-calibrated accuracy
"Not every problem has a ready-made solution. Sometimes you have to build it yourself."
🎯 The Challenge
I needed a way to visualize my AutoCAD slope plan drawings directly on Google Earth accurately, not approximately. No existing plugin did exactly what I needed. Existing tools either lacked precision, couldn't handle Nepal's coordinate system, or produced KML files with unacceptable errors.
📐 Project Coordinate Bounds
🚀 My Journey: Building the Solution
No plugin could handle Nepal Grid with precision
Mastered entity reading & coordinate extraction
Nepal Grid → Lat/Long with GPS calibration
Achieved perfect KML output after iterations
The Solution
My custom AutoLISP script reads every entity in the drawing, converts Nepal National Grid coordinates to real-world latitude and longitude, applies GPS-calibrated corrections, and exports a clean KML file ready for Google Earth.
Key Features
- 📁 Reads all drawing entities automatically
- 🗺️ Precise Nepal Grid → Lat/Long conversion
- 📡 GPS-calibrated correction algorithm
- 📄 Clean, ready-to-use KML output
- 📐 Preserves all drawing geometry
📝 AutoLISP Code Snippet
;; Select all entities in drawing
(setq ss (ssget "_X"))
;; Loop through each entity
(foreach ent (ssnamex ss)
;; Extract coordinates
(setq ptList (cons (get-coordinates ent) ptList))
)
;; Convert to KML format
(write-kml ptList)
princ
)
✅ What I Achieved
📚 Explore My Other Articles
🏗️ Str Analysis, BBS and Estimation
Structural Analysis of beam, column, slab, foundation along with Bar bending schedule and estimation of building
📐 Ramp Modeling in ETABS
Inclined surface design, load analysis, and structural behavior
🌊 Flood Animation Using ArcMap
GIS-based flood simulation near Koshi Barrage, Nepal
🏗️ Pushover Analysis in ETABS
Nonlinear static analysis for seismic performance evaluation
⚙️ ETABS Section Designer
Creating custom frame sections with any shape imaginable
🏔️ Step-Back Building in ETABS
Designing resilient structures on sloped terrains
🤖 Interactive Map in 5 mins with AI
Using ChatGPT and DeepSeek to create Python maps
📊 Concrete Mix Design Calculator
Excel-based tool following IS10262:2019 and IS456:2000
🏗️ Box Culvert - First Lift Concreting
Multi-lift construction techniques for mass concrete (box culvert inlet chamber)
🏗️ Box Culvert - Main Chamber (2m×2m)
Rebar arrangement, concrete and machinery arrangement
🪨 Mechanically Stabilized Earth (MSE) Wall
Compaction guidelines and density inspection requirements
💻 Interactive Choropleth Map
US-based Population Count