Skip to content

v.in.dxf

Converts file in DXF format to GRASS vector map.

v.in.dxf [-etbfli1] input=name output=name [layers=string [,string,...]] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

v.in.dxf input=name output=name

grass.script.run_command("v.in.dxf", input, output, layers=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("v.in.dxf", input="name", output="name")

Parameters

input=name [required]
    Path to input DXF file
output=name [required]
    Name for output vector map
layers=string [,string,...]
    List of DXF layers to import (default: all)
-e
    Ignore the map extent of DXF file
-t
    Do not create attribute table
-b
    Do not build topology
    Advantageous when handling a large number of points
-f
    Import polyface meshes as 3D wire frame
-l
    List available DXF layers and exit
-i
    Invert selection by DXF layers (don't import layers in list)
-1
    Import all objects into one layer
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Path to input DXF file
    Used as: input, file, name
output : str, required
    Name for output vector map
    Used as: output, vector, name
layers : str | list[str], optional
    List of DXF layers to import (default: all)
flags : str, optional
    Allowed values: e, t, b, f, l, i, 1
    e
        Ignore the map extent of DXF file
    t
        Do not create attribute table
    b
        Do not build topology
        Advantageous when handling a large number of points
    f
        Import polyface meshes as 3D wire frame
    l
        List available DXF layers and exit
    i
        Invert selection by DXF layers (don't import layers in list)
    1
        Import all objects into one layer
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

v.in.dxf converts DXF format CAD files to GRASS vector format. The following graphical objects (DXF entities) are supported:

  • point
  • DXF POINT
  • line
  • DXF LINE
  • DXF POLYLINE
  • DXF LWPOLYLINE
  • DXF ARC
  • DXF CIRCLE
  • DXF TEXT
  • face
  • DXF POLYFACE MESHES
  • DXF 3DFACE

Table and column names are changed to lowercase characters for easier SQL usage (lowercase table/column names avoid the need to quote them if the attribute table is stored in a SQL DBMS such as PostgreSQL).

The "layer" column will contain the name(s) of the DXF input layer(s). The DXF entity type string will be stored in the "entity" column as uppercase.

The "handle" column can be used to store small bits of data associated with any entity in the DXF file (i.e., entity handle or unique object identifiers in the layer). The entity handle is a "text string of up to 16 hexadecimal digits", which is a 64-bit integer (currently not supported by GRASS database drivers). For text type entities, the text value will be stored in the "label" column of the GRASS vector output map. Neither the "handle" nor "label" column is mandatory.

REFERENCES

AutoCad DXF (from Wikipedia, the free encyclopedia)
DXF References (Autodesk-supplied documentation)

SEE ALSO

v.out.dxf, v.in.ogr, v.out.ogr

How-to import DXF files in wxGUI (from GRASS User Wiki)

AUTHORS

Original written by Chuck Ehlschlaeger, 6/1989
Revised by Dave Gerdes, 12/1989
US Army Construction Engineering Research Lab

Updated for GRASS 6 and 3D support. Huidae Cho, 3/2006
With minor additions by Benjamin Ducke (Oxford Archaeology), 4/2009

SOURCE CODE

Available at: v.in.dxf source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f