Feature request #2989

improve reading of DWG to equal DNG functionality

Added by dcarreira - over 6 years ago. Updated about 6 years ago.

Status:Closed Start Date:
Priority:Low Due date:
Assigned to:J├╝rgen Fischer % Done:


Target version:Version 1.6.0
Platform:Windows Resolution:wontfix
Platform version: Pull Request or Patch supplied:No
Status info:0 Tag:


QGIS already reads DGN files (at least v7), mixing all geometry types in one single layer.

One can then filter each geometry type by querying the dgn layer. For example, to filter all lines you can use this query:

"Type" IN ('3','4','12','14','16','15')

The layer will have only lines after this query is applyed. To know which type codes correspond to each geometry type you can lookup on certain web pages, like:



I attached an example dgn file where you can exercise this kind of filtering.

You can also by this means, get all text elements:

"Type" = '17'

Note that QGIS does not reset the symbology according to the query results. So the default line symbology is kept and nothing is visible since the layer now holds only points. To workaround this limitation, you have only to change the symbology type to "Categorized", and then back to "Single Symbol". QGIS will pick up on the geometry type and propose the default point symbol. At this stage you can see the text points.

Since all DGN attributes that are captured by OGR are available to QGIS you can also show the texts by labeling the points.

Finally, you can export each geometry type to separate shapefiles. Later on, you can work these shapefiles and further filter elements by level (the dgn's equivalent to dwg's layers).

This process allows QGIS to work with CAD data directly, without requiring external tools, like ogr2ogr. Extending this support to dwg would be a breakthrough!

0243-P0140-04.7z - dgn example file (197.6 kB) dcarreira -, 09/08/2010 08:36 am


Updated by Paolo Cavallini about 6 years ago

  • Status changed from Open to Closed
  • Resolution set to wontfix

DWG is a proprietary format. No free and open source software can read it effectively. DXF, on the other hand, is supported through OGR.

Also available in: Atom