Giter Club home page Giter Club logo

dwg2csv's Introduction

dwg2csv

Export data from dwg files via AutoCAD ActiveX API

This set of Python scripts and other files was born in 2011, when I was working on a task with goal to migrate some data from AutoCAD to a GIS solution. For data access interface I had chosen AutoCAD ActiveX API (that was a mistake, after all). For data processing and scripting the Python was selected because it's my favorite programming language.

Export from DWG (AutoCAD) to CSV.

COM (ActiveX) AutoCAD API was used for access to drawing entities and for extracting geometry and attributes from them.

Python modules comtypes.client, comtypes.gen used for interaction with AutoCAD. Module csv.writer for data export.

For make it work you will need MS Windows, Autodesk AutoCAD, Python >= 2.5.

Contents:

  • dwg.dump.py -- exporting program, work with current AutoCAD drawing unless you're run this script with a parameter: filename.dwg.
  • snippets.py -- AutoCAD ActiveX objects wrapper.
  • trig.py -- functions for coordinates transformation and other math stuff.
  • dwg.list -- list of input dwg files example.
  • rip.cmd -- runner cmd script example.
  • test.py -- tests for recovery DWG entities from exported data.
  • ora/csv.lob2ora.py -- CSV to Oracle loader, load data exported from DWG to Oracle DB using cx_Oracle. For coords data CLOB field was used because of data size.
  • ora/csv2ora.cmd -- cmd script for csv2ora loader.
  • ora/building.py -- select buildings data (polygon) from raw material and load to featureclass table.
  • ora/fountain_p.py -- same thing for fountains (point).

extra/autocad.bulge/FacetBulge_rev1.zip -- some formulas (partly correct) from http://www.cadtutor.net/forum/showthread.php?51511-Points-along-a-lwpoly-arc

My related blog posts:

dwg2csv's People

Contributors

vasnake avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.