Export coordinates from CAD to txt

Let's assume that we want to export points from CAD format, to a comma separated list so as to upload to a total station and do a site stakeout. Previously we had seen how to import them from excel or txt With AutoCAD y With Microstation, Now let's see how to export them.

There are different ways to do it, such as counting the cows, you can count the legs and divide them by four or you can just count the cows. Let's look at some ways:

1 Doing it with Microstation (dgn to txt)

In the example, I have a plot that has five vertices, and I need to export the coordinates to a txt file.

For this, I have put the points in a thickness that are visible. Remember that line weights in Microstation are dynamic, so they are immediately noticeable.

Dgn to txt

First step: Activate the coordinate export tool (if it is not active), for this we select

Tool boxes
We activate the last command (xyz)
Then we closed the panel and should have been activated this way

Xyz dgn

Second step: Select the points we want to export, then select the “export coordinates” command, which is the up arrow, and fill in the conditions:Export coordinates

-Data file
-File name
-Order of coordinates
- Primary units
-Prefix / suffix
- Initial number

The panel allows you to choose the options, if only the selected drawings (single), the drawings inside a fence or all the file (all)

The end result is a .txt file that you can open from excel.

In my case I have assigned number, marking the checkbox that is on the right

In case the file already exists a window that asks if you want to replace or add (add or append) is displayed.

Txt coordinatesTo identify which are the points, microstation draws you numbers in each point, with the color, type of line and size of text that you have active.

2 Doing it with AutoCAD

Before knowing CivilCAD (Softdesk) we used a DOS application that is still there called Dxf2csv. You can try it if you like to torture yourself with nostalgia, 🙂 there are also some apps”not free“, and I'm sure there must be some free but in this case we will see how it is done with Softdesk8, it is similar in CivilCAD.

In order to make the points visible, I have changed the format with format/format point/ point style. In order for the thickness of the lines to be visible, you have to activate “Lts”, using a value less than 1 until we see the difference.

Dwg to txt

First step: Open a project or create a new project

Softdesk programs (save file first time)
Create project
Assign project name, then ok
We choose the number where the numbering begins
Ok ok, ok then
we choose “cogo”, then ok

Second step: Enter the points to the database: for this, there are different forms, in this case we will do it automatically: Points / set points / automatic, then select each line of the polygon.
The signal that were entered is to make points / set points / list avaible points. It should show +6, which means there are already 5 points entered into the database.

Third step: Export the points.
To export the points we do:

-points / import-export points / export points to file
- Select the export format, in this case PNE (point, northing, easting)
-We choose the destination folder of the file and write the name
-In the command bar we choose the export options (by selection, by rank ... in this case we use all, all)
-List, the file has gone, in this case separated by expacios but equal can be opened with excel

Autocad txt

In case the points are written in too large sizes, you have to change the metric units because by default come the English (AEC / setup drawing / unit angles / choose métric)

This time the points did not have elevation, that subject we will see in another post, when we speak of curves of level.

Tolerate my insistence, does anyone know a macro for atocad that is simpler and free?

Does anyone else do it?

Golgi Alvarez

Writer, researcher, specialist in Land Management Models. He has participated in the conceptualization and implementation of models such as: National Property Administration System SINAP in Honduras, Management Model of Joint Municipalities in Honduras, Integrated Cadastre-Registry Management Model in Nicaragua, Territory Administration System SAT in Colombia . Editor of the Geofumadas knowledge blog since 2007 and creator of the AulaGEO Academy that includes more than 100 courses on GIS - CAD - BIM - Digital Twins topics.

Related Articles


  1. For that, you need CivilCAD or Civil3D. Both are specialized modules that work on AutoCAD.
    AutoCAD alone does not allow you to do that.

  2. apologize for my initiation, I need to know how to pass and / or draw cuts or section in autocad directly with reading height and distances (track width) each 20 mt. longitudinal and at the same time I go calculating the volume of fillings and excavations directly in autocad

  3. good this post is excellent there are many support tools to simplify the work and it would also be good to rely on civilcad that is very practical to use, but the important thing is to know the origin of each concept

  4. Good steps keep teaching us

  5. Hello Kovos in this post We explain how to do it with Softdesk8. I commented that we can not through this blog recommend ways to acquire pirated software, in this post I mentioned that Vuze It works for that, but it's at your risk.

  6. How do I draw the level curves in Aautocad? How do I download the softdesk8?

  7. Hello Jorge Luis

    First, in the total station, it exports the points to .txt format, preferably in order: x coordinate, y coordinate, elevation, description.

    Then open them with Excel, choosing the file of type .txt

    Choose the option delimited by commas, so you can separate the columns

    To have them in excel I recommend that you use this tool, Which exports excel to dxf

  8. I need the steps to be able to export the station points to excel… Thanks


  9. I would appreciate it, please. It is for my thesis and I only have to do this to advance and culminate. THANK YOU.

  10. Daniel, let me find a vba I used some time ago and upload it for you to try

    Give me this day

  11. No, that only serves you to import points.
    I'll get a vba and I'll upload it for you to try.




    Thanks, but my case is this:

    I have a database in Excel where I have the origin coordinates and destination coordinates, and I want it to draw the lines in autocad. “””BUT””” Without copying and pasting, but rather the operation is automatic, that is, with a macro or some code to create the interface, or perhaps within AUTOCAD or MICROSTATION THERE IS THAT INTERFACE that imports data from excel AUTOCAD or MICROSTATION if it is the case

    You suggest me galvarezhn
    ??????????? THANK YOU

  14. I am a THESISIST and I am looking for how I can automatically draw lines in AutoCAD from a database in Excel, that is, having the coordinates ORIGIN and coordinates DESTINATIONS


  15. This lisp can do it

    (Defun c: txt-xyzs ()
    (Setq a (ssget)
    N (sslength a)
    f (open (getstring “\nfilename: “) “w”)
    (Repeat n
    (Setq name (ssname ai)
    Ent (entget name)
    Tp (cdr (assoc 0 ent))

    (if (= “TEXT” tp)
    (If (and (= (cdr (assoc 71 ent)) 0) (= (cdr (assoc 72 ent)) 0))
    (Setq ip (cdr (assoc 10 ent))
    X (rtos (car ip) 2 2)
    And (rtos (cadr ip) 2 2)
    Z (rtos (caddr ip) 2 2)
    S (cdr (assoc 1 ent))
    (princ(strcat x", "y", "z", "s"\n") f)
    ); Left-justified text
    (Setq ip (cdr (assoc 11 ent))
    X (rtos (car ip) 2 2)
    And (rtos (cadr ip) 2 2)
    Z (rtos (caddr ip) 2 2)
    S (cdr (assoc 1 ent))
    (princ(strcat x", "y", "z", "s"\n") f)
    ); Other than left-justified
    ); If
    ); If

    (if (= "MTEXT" tp)
    (Setq ip (cdr (assoc 10 ent))
    X (rtos (car ip) 2 2)
    And (rtos (cadr ip) 2 2)
    Z (rtos (caddr ip) 2 2)
    S (cdr (assoc 1 ent))
    (princ(strcat x", "y", "z", "s"\n") f)
    ); Left-justified text
    ); If mtext

    (Setq i (1 + i))
    ); Repeat
    (Close f)

Leave a comment

Your email address will not be published. Required fields are marked with *

Back to top button