Skip to main content
11 votes

Importing DXF in QGIS 3

Option 1: You don't need a plugin for that. You can import DXF (or DWG) in Qgis with a built in option: go to: project >> Import/Export >> Import Layers form DWG/DXF . Later you can export or save it ...
Ofir's user avatar
  • 677
10 votes

Exporting to DXF file from QGIS?

There is now native export into DXF in newer versions of QGIS which allows to export map layers including the labels: More about the functionality can be found here: https://www.qgis.ch/en/projects/...
Miro's user avatar
  • 9,744
8 votes
Accepted

QGIS Export: Set DXF Layers By Attribute

For the sake of closure (and in case I need to look this up again) I'm posting how I created my DXF file with layers. This uses ogr2ogr, but I used the QGIS toolbox so I guess technically it could ...
Don's user avatar
  • 576
7 votes

Importing 3D DXF file into QGIS with z information as attribute value?

Miro's answer will work fine, but if you just want to add a Z value to your attributes table (perhaps for labeling in a map or some other reason), I would start as he suggests: v.in.dxf - to import ...
MappaGnosis's user avatar
  • 33.9k
7 votes
Accepted

Can't export geometry generator styling to DXF - alternatives?

I'm not sure which update of QGIS 2.x and 3.x changed it, but as of 2018 November and probably earlier, geometry generator symbology styling does get exported with the native QGIS dxf exporter. ...
she_weeds's user avatar
  • 12.5k
6 votes
Accepted

Export DXF from QGIS layer using PyQGIS?

You can take example on the code in qgisapp.cpp and transform it to python as follows (just replace the elements within underscores): dxfExport = QgsDxfExport() settings = iface.mapCanvas()....
Denis Rouzaud's user avatar
6 votes
Accepted

Export Project to DXF dialog using Python

Does DxfLayer even support multiple inputs? No. The error QgsDxfExport.DxfLayer(QgsDxfExport.DxfLayer): argument 1 has unexpected type 'list' states that, explicitly. But you can use dxfExport....
Kadir Şahbaz's user avatar
5 votes

Stop automatic ANSI_1252 to UTF-8 encoding when adding a DXF layer?

One possible solution to the problem: Open the DXF file in a texteditor and save the file with the encoding that is used by QGIS. In my case I had a DXF file exported from AutoCAD with encoding UTF-8, ...
GeogRaphy's user avatar
5 votes
Accepted

Import .dxf with pyqgis

When constructing the layer URI, remove blank spaces and use geometrytype parameter (all in lower-case) instead of geometryType. See the PyQGIS Cookbook for reference. The relevant part in your code ...
Germán Carrillo's user avatar
5 votes
Accepted

Existing C++ libraries that convert ESRI shapefile to DXF/DWG

GDAL supports open ESRI Shapefile and save it as DXF. The C++ API intro is here: https://gdal.org/ogr_apitut.html
Dmitry Baryshnikov's user avatar
5 votes
Accepted

Converting GeoDataFrame to DXF using GeoPandas

GeoPandas supports dxf. You just have to keep in mind that dxf can hold only geometry, not attributes, which means that you have to save GeoSeries, not GeoDataFrame. geodataframes = [gdf1, gfd2, gdf3] ...
martinfleis's user avatar
  • 2,417
5 votes
Accepted

Speeding up the import of DXF files in QGIS

I would recommend the QGIS plugin AnotherDXFImporter - it is included in the official QGIS plugin repository. Importing DXF is significantly faster and it does a really good job copying the original ...
sn1ks's user avatar
  • 3,002
5 votes

What does exec(Path('C:/PROGRA~1/KMSpico/temp/tmpq2wwvz7_.py').read_text()) mean?

Because you haven't saved that script, QGIS is writing that code to a temporary file. QGIS then: Reads that temporary file containing your code as text: Path.read_text Executes the text read from the ...
user2856's user avatar
  • 65.9k
5 votes

What does exec(Path('C:/PROGRA~1/KMSpico/temp/tmpq2wwvz7_.py').read_text()) mean?

When you run an unsaved script in QGIS Python Editor, QGIS saves it as a temporary file, reads the file using read_text() and runs that temporary py file using exec function of Python. In your case, ...
Kadir Şahbaz's user avatar
4 votes

Label rotation values in DXF imported into QGIS

Answer of Carlos is good. Just some precision here. Concerning angle calculation : -0.8028514559 * 180 / pi() = -46 -46° is equivalent to +314° : 360 - 46 = 314 To setup your layer : On your ...
Pierma's user avatar
  • 901
4 votes

How georeference a DXF file in QGIS 2.14?

You can use affine transformation plugin if you know the offset of the vectors, DXF have to be converted to QGIS editable format (e.g. shapefile) You can use LibreCAD to translate the DXF file You can ...
Zoltan's user avatar
  • 7,325
4 votes
Accepted

Export to DXF from PostgreSQL using ogr2ogr

You need a Layer attribute in your input into ogr2ogr for it to convert into layers in CAD. I wrote a post about this for a straightforward GML to DXF conversion, using an intermediate step of ...
HeikkiVesanto's user avatar
4 votes

Export DXF from QGIS layer using PyQGIS?

If I use your code in the Python Console with the QgsVectorFileWriter() class , the value 5 is returned which seems to be a ErrAttributeCreationFailed. We could skip the attribute creation using ...
Joseph's user avatar
  • 75.8k
4 votes

Export DXF from QGIS layer using PyQGIS?

Suggested solution: using the ogr library, with this approach it is possible to set the value of the "Layer" attribute of the DXF with an attribute from the inLayer. from osgeo import ogr import os ...
NettaB's user avatar
  • 1,946
4 votes

Convert DWG to SHP in QGIS?

Convert from DWG to DXF to SHP: Download and open ODA File converter: https://www.opendesign.com/guestfiles Convert DWG to DXF (Choose lastest year - mine was 2018 - ASCII DXF) Use QGIS Plugin '...
ClearMappingCo's user avatar
4 votes

Re-scaling and moving vector layer manually in QGIS

I was a tester of the 3.0 version of QAD plugin, which I consider an impressive programming job. The plugin is still in the experimental phase, but you can install it if you enable the option to ...
Gabriel De Luca's user avatar
4 votes

Re-scaling and moving vector layer manually in QGIS

The Plugin AnotherDXFImporter contains a module for georeferencing: 3.2.1. Parameter By means of X and Y offset, a simple displacement of the DXF can be achieved. This is y.B. useful when the ...
Mike -EZUSoft-'s user avatar
4 votes

QGIS: exporting contours to DXF with height values

Try using the Set Z value tool in Processing Toolbox > Vector geomoetry instead of Grass. Use the icon to the right of the Z Value input and click Edit to add an expression. For the expression just ...
TeddyTedTed's user avatar
  • 6,100
3 votes
Accepted

Converting LAS to DWG/DXF using open-source software?

You may use las2ogr (las utility application), but your GDAL libraries must be built with libLAS. Convert las file to txt using las2txt (las utility application) and use ogr2ogr converting CSV file to ...
Zoltan's user avatar
  • 7,325
3 votes

Batch export multiple layers to DXF

Under Processing toolbox (you need to have it switched to Advanced interface) you can find GRASS command v.out.dxf which with right click on it you can execute as batch process. After that you can ...
Miro's user avatar
  • 9,744
3 votes
Accepted

How georeference a DXF file in QGIS 2.14?

I think it is a duplicate of How to georeference a dxf?,How to georeference a vector layer with control points? 1) Using the limits of the Carta Administrativa Oficial de Portugal (shapefile, the ...
gene's user avatar
  • 54.9k
3 votes

Importing DXF to QGIS results in all lines being same colour?

For anyone reading this now consider using the plugin Another DXF Import/Converter (available for Q 2.18 and 3.x) - it will pull out the colour attributes of all text, line and polygon objects from ...
she_weeds's user avatar
  • 12.5k
3 votes

Georeferencing DXF using QGIS?

The Plugin AnotherDXF2Shape contains a Georeferencing modul: Parameter By means of X and Y offset, a simple displacement of the DXF can be achieved. This is y.B. useful when the original coordinates ...
Mike -EZUSoft-'s user avatar
3 votes
Accepted

DXF Import QGIS: Text Components

The current version of the Plugin: Another DXF Importer / DXF2Shape Converter support textangles and other stuff like text size, text color, position (text-align), color, individual text formats http:/...
Mike -EZUSoft-'s user avatar

Only top scored, non community-wiki answers of a minimum length are eligible