[QGIS-Developer] How to save a DXF 3D using pyQgis ?

Matthias Kuhn matthias at opengis.ch
Sun Oct 18 22:04:03 PDT 2020


You could also use QgsDxfExport, which exports a whole project.

https://qgis.org/api/classQgsDxfExport.html

Have a look at the tests for sample implementations:

https://github.com/qgis/QGIS/blob/master/tests/src/core/testqgsdxfexport.cpp

Best regards
Matthias

On Sun, Oct 18, 2020 at 7:07 PM Geo DrinX <geodrinx at gmail.com> wrote:

> Good evening to all,
>
> as in object,  there is a way to save a DXF from a 3D polygon layer, using
> pyQgis ?
>
> I am using:
>
> QgsVectorFileWriter.writeAsVectorFormat(layer, file, "UTF-8", crsCrs,
> "DXF", overrideGeometryType=QgsWkbTypes.PolygonZ,skipAttributeCreation=True)
>
> but (also it works with other file types) the option
> "overrideGeometryType" seems to be irrilevant with DXF, and it saves in 2D.
>
> Someone can help me to discover the correct syntax ?
>
> Thank you in advance
>
> Roberto
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20201019/6754ae4c/attachment.html>


More information about the QGIS-Developer mailing list