You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
955 B
Markdown

7 years ago
# dxf-to-csv #
__dxf-to-csv__ is a tool to extract coordinates from CAD drawings.
7 years ago
AutoCAD offers the `LIST` command, which shows the geometry of selected objects, but this approach is not practical when dealing with a large number of objects.
7 years ago
![AutoCAD list command](doc/autocad-list.png)
## Installation ##
7 years ago
```
pip install dxfgrabber
```
Then
```
git clone http://git.wrl.unsw.edu.au:3000/gis-cad/dxf-to-csv.git
cd dxf-to-csv
python setup.py install
```
## Usage ##
Show available layers:
7 years ago
`dxf_to_csv drawing.dxf -l`
Convert all layers:
7 years ago
`dxf_to_csv drawing.dxf`
Convert specific layer:
7 years ago
`dxf_to_csv drawing.dxf -n LAYER_NAME`
## Output ##
`drawing.csv`
| layer | type | id | x | y | z |
| :---- | :--------- | ---: | ------: | ------: | ---: |
| MAP | LWPOLYLINE | 9896 | 202.568 | -41.517 | 0 |
| MAP | LWPOLYLINE | 9896 | 206.053 | -40.062 | 0 |
| MAP | LWPOLYLINE | 9896 | 207.450 | -36.796 | 0 |