3

As said on this page https://gdal.org/drivers/vector/dxf.html,

GDAL writes DXF files with measurement units set to “Imperial - Inches”. If you need to change the units, edit the $MEASUREMENT and $INSUNITS variables in the header template

$MEASUREMENT and $INSUNITS are the variables in Autocad in order to choose between an imperial and a metric system.

As I never use the imperial system, is it possible to configure Qgis in order to systematically export vector layers in DXF format with a metric system? I precise that my Qgis is configured with the language, numbers, date and currency formats from the US).

I totally agree with the fact that this is not a big problem, but I have the feeling to lose so much time everyday just to change the unity from the imperial to the metric system in Autocad.

I think it would be interesting in the future to let that choice to the user in the "Save Vector Layer as ..." window...

2
  • Did you try "Project -> Export to DXF"? Jan 30, 2020 at 10:36
  • Yes, the problem is the same. Jan 30, 2020 at 10:42

1 Answer 1

1

I finally figured out what meant "edit the $MEASUREMENT and $INSUNITS variables in the header template".

The header template is located here: C:\OSGeo4W\apps\gdal\share\gdal\header.dxf

This is an ASCII DXF file that contains the variables $MEASUREMENT and $INSUNITS. Originally, these variables are :

$MEASUREMENT
    70
         0
      9

and

$INSUNITS
 70
     1
  9

which correspond to the imperial units. According to the documentation for $MEASUREMENT and $INSUNITS and with the help of a text editor, I changed the parameters to :

$MEASUREMENT
 70
     1
  9

and

$INSUNITS
 70
     6
  9

Unfortunately, this solution only works for data exported layer by layer (and not by Project>Import/Export>Export Project to DXF...).

If someone has an idea about it, I'll take it.

Your Answer

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

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