10

Is it possible to export labels based on Shapefile attributes into a DXF file?

I use QGIS 1.7.4.

I've been reading a CSV file and view it as a Shape Layer. With the help of attributes from the File I will label the points. Now I want a DXF export with the labels. However, only the Points in the DXF file Export.

I do not have ArcGIS.

I am using AutoCAD LT 2011 for viewing DXF files. In AutoCAD I have to go through the "Insert / Link & extraction" under only the possibility to find data from Excel.

7
  • 1
    On wich platform? ArcGIS? May 4, 2012 at 19:04
  • Why would you like to export as DXF? Which program do you wnat to use to read the exported files? Perhaps there are better ways. In general dxf is a rather poorly supported fileformat.
    – johanvdw
    May 4, 2012 at 19:40
  • Which version are you using, and what OS.
    – Nathan W
    Jul 17, 2012 at 12:23
  • 2
    Had you selected something?
    – Ian Turton
    Jul 17, 2012 at 12:34
  • I think there are too many limitations for a solution without getting help from someone who has more tools. LT does not allow for programming or much manipulation. You need at least autocad or autocad map would be better. you could then create points with attributes and either make them into blocks or simply label the points. You can get closer by doing an export from qgis and include the xy coordinates in the csv, or shape file. if you had map you could just import the shp file and label it.
    – Brad Nesom
    Sep 21, 2012 at 3:45

9 Answers 9

10

There is now native export into DXF in newer versions of QGIS which allows to export map layers including the labels:

Native DXF export in QGIS

More about the functionality can be found here: https://www.qgis.ch/en/projects/dxf-export

The DXF export functionality was developed by Jürgen Fischer (Norbit) and Marco Hugentobler (Sourcepole AG). The project was co-financed by SIGE (utility provider in Vevey) and the municipalities of Vevey, Morges and Uster.

4
  • I have used the DXF Export... with success once and since I have run into problems. I am trying to export point data to dxf. Instead of converting the points to points, it converts them to polygons and polylines (without attribute information). I have tried using projected shapefiles and wgs84 and varying number of columns and nothing has worked so far. Oct 4, 2018 at 15:43
  • @user3386170 This DXF export is meant to be to export the whole map more over the export of one layer. If you are after export of one layer as feautures, just right click on the layer, and select "Save as..." and AutoCad DXF format.
    – Miro
    Oct 12, 2018 at 3:30
  • I did click on only one layer and that is how to problem arose. Oct 19, 2018 at 19:17
  • I have reread by answer and realized that I did not clarify properly. I want to export labels with my dxf files. The save as... function does not export labels, just attribute tables with random information. The DXF Export... does export labels (that is the OP goal for this question), but with the possible bug that I have found. Nov 12, 2018 at 14:13
6

In QgiS: rightclick in left panel on layer and use save as and select Autocad dxf as export format - this works for me. areyou using qgis 1.8?

edit: I now also tried "save selection as", seems to work too

edit #2 : I enclose a screenshot from qgis: QGis with the layer to be exported to dxf

and one screenshot from inkscape with the imported dxf-file: one polygon was changed to a red-fill-color after importing

4
  • Kurt, have you tested the resulting files? They don't work for me.
    – Allison
    Apr 29, 2013 at 16:44
  • Yes, please see my updated post above , which now shows two screenshots. the second screenshot shows the imported dxf in inkscape. for one polygon I changed the fill-color to red after importing.
    – Kurt
    Apr 30, 2013 at 4:46
  • Does it have to be unprojected? I was able to make it work if in WGS. And is there a way to get attribute info into the dxf? Some programming stuff in the empty box?? Thanks.
    – Allison
    Apr 30, 2013 at 14:17
  • no it does not to be unprojected- I have no clue about your other questions, but I believe not that you can get the attributes into dxf....
    – Kurt
    Apr 30, 2013 at 17:26
4

If you want the labels in CAD, here's a workaround (you're not being very specific as to what you're trying to accomplish). In ESRI, create a point file for the centroid of each label. Populate the label field in the attribute table.

Next, in a "map capable" version of AutoCAD, tpye "mapconnect" in the command line. This will bring up the screen shown below (I'm assuming you know how to manage coordinate systems in CAD). First, select "Add SHP connection". Next, click the SHP ellipsoid (shown with #2) and navigate to the location of your point shapefile. Lastly (step #3) hit the connect function, and inside that menu, hit "add to map" Now all you need to do is make your points invisible and turn on the labels (which will require you to switch to a Geospatial interface in CAD -- shown in next printscreen).

enter image description here

There are Geospatial functions available in CAD. Under the arrow highlighted below, you can see that there are Geospatial functionalities inherent to CAD (map capable versions that is). The icon looks very much like a gear (Beside "Dano1" in my printscreen). This menu can be found in the bottom right portion of your screen. If you get this far and are not sure how to proceed, the only this I can suggest is that you post another question related to labeling spatial data in CAD.

enter image description here

2

There is now native export into DXF in newer versions of QGIS which allows to export map layers including the labels:

Native DXF export in QGIS

More about the functionality can be found here: https://www.qgis.ch/en/projects/dxf-export

The DXF export functionality was developed by Jürgen Fischer (Norbit) and Marco Hugentobler (Sourcepole AG). The project was co-financed by SIGE (utility provider in Vevey) and the municipalities of Vevey, Morges and Uster.

1

I've just had the same problem: the dxf-file exported from QGIS seemed empty.

But when I checked the "Layout" in my CAD programme (BRICS CAD), it does exist. All I had to do was find the proper view, in my programme "View" and "2D-context".

1

I found this free Converting Shapefiles and ArcINFO Coverages To AutoCAD DXF Format tool at Free Geography Tools that will create a .dxf from a shapefile.

You can specify the attribute field that you want converted to dxf Text labels.

I ran the tool and it worked as expected.

1

I used "Export to Dxf" and I had the same problem, no lables. Then I defined the "symbology scale" (it was set to 0) as 1:20000, and it worked...the lables were exported.

0

If you use ArcGIS then in my opinion the most stable solution is to convert the annotations to polygons then export to DXF. I use the same approach for exporting annotations to KMZ which unlike exporting annotations directly yields very high resolution labels in the resulting KMZ.

Unfortunately, this requires you to convert annotations to polygons for which there isn't an OOTB tool. I built my own addin for this. I can post the code if you'd like.

0

I had the same problem and I finally succeeded exporting from QGIS (1.7) to autocad doing the following:

1.- Select elements to export

2.- Go to layer/save selection as and choose the format "ESRI Shapefile" (no dxf!!!)

3.-Then use Arcv2CAD (has to be bought) to transform the shape file to dxf. That dxf can be opened by Autocad!! :)

There may be an simpler way to do so... Or even to export elements from different layers at once, but I have not found it yet!! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.