From the Ground Up
A European perspective on design and out of the box thinking with Civil 3D.
About Jack About OveLatest Post
- posted 12/13/07 by Ove Cervin Coordinates to ASCII
- Hi everyone.
I have been a bit quite the last couple of weeks due to several reasons...
Here in Scandinavia it is totally pitch black - complete darkness has come as it is late December. What we do have regarding lights is - Lucia. December 13:th (today) is the day for celebrating Lucia.

It's a tradition here in Scandinavia. (Read about it here if you want more feeling for it...)
This topic will be about how to use a function that are within AutoCAD Map 3D 2008, which you have also in Civil 3D. If you have a set of objects, Polylines in this example, and want the coordinates for them out to a file, this is one way. I have saved the Polylines in one drawing called "Polylines input to Map.dwg". They look like this:

Save that drawing and close it.
Open a new drawing and use the Map Query to get the data. To do that I will explain how to get the "Tools" available.
On the command line, use:
Command: _mapwspace
Task Pane [On/oFf]:
Task Pane is visible.
Then select the Tab "Map Explorer".

Right click on "Drawings" and select "Attach".

If your drawing is located anywhere else than locally on "C:\" you need to set up an "Alias" for that drive/folder.
Click the button to access the Alias dialog.

Type in an alias and browse to the folder - use ADD.

After that you can use the alias and browse to and select the source drawing.

Once the link is established you can see it in the workspace.

To get the data in to this drawing you can right click on the link and select "Quick View".

Use Zoom Extents to see the objects as a "Preview". Note that you can't access the objects. They are only shown as one object.

Now we know that data is connected, and we do see it.
Create a Map Query. Right click on "Current Query", as below, and select "Define".

Now we need to tell what to get/select in that attached drawing. (It could also be from a dwg containing loads of different data).
Select "Location".

Select "All". This will select all data from any location in the dwg.
Then select "Property".

To make sure we don't get any "hidden" objects we specify that we also have the condition "Layer". Here you set "Value to match the Layer where the Polylines are stored.

Value will be "Exported-Polylines" which is the Layer in the source drawing.


As we don't (in this case) want the graphics in, only a Report, we select "Report" instead of "Draw".

Hit "Options" and then "Expression..."

Use "Properties" and scroll down to "X1,Y1,Z1"

Type in a path and report name. Also use "Process Sub-Objects".

Click "OK" and then in the main dialog - "Execute Query".

As seen on command line - the query found some data.

It is now stored in the .txt as below. X, Y and Z value.

I hope it can help in some way. Note that you also get all data as "one string". Just to be aware...
It might be enhanced in several ways in the Report and Expression.
Cheers / Ove C
