Feature request #2989

improve reading of DWG to equal DGN functionality

Added by dcarreira - almost 7 years ago. Updated about 1 month ago.

Assignee:Jürgen Fischer
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No


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 (198 KB) dcarreira -, 09/08/2010 08:36 AM


#1 Updated by Paolo Cavallini over 6 years ago

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

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

#2 Updated by Jürgen Fischer about 1 month ago

  • Resolution changed from wontfix to fixed/implemented
  • Pull Request or Patch supplied set to No
  • Description updated (diff)
  • Subject changed from improve reading of DWG to equal DNG functionality to improve reading of DWG to equal DGN functionality

Also available in: Atom PDF