Wolfram Language & System 10.0 (2014)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

DXF (.dxf)


    MIME types: image/vnd.dxf, image/x-dxf
    AutoCAD DXF format.
    3D geometry format.
    Commonly used for the exchange of CAD data.
    Plain text ASCII or binary format.
    DXF is an acronym derived from Drawing Exchange Format.
    Stores a 3D object as a collection of line and polygon primitives and their properties.
    Introduced in 1982.

Import and ExportImport and Export

  • Import["file.dxf"] imports a DXF file as a Graphics3D object.
  • Export["file.dxf",expr] exports a Graphics3D expression to DXF.
  • Import["file.dxf"] returns an expression of the form Graphics3D[GraphicsComplex[vertices,primitives,opts]].
  • Import["file.dxf",elem] imports the specified element from a DXF file.
  • Import["file.dxf",{elem,suba,subb,}] imports a subelement.
  • Import["file.dxf",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","DXF"] or Import["file",{"DXF",elem,}].
  • Export["file.dxf",expr,elem] creates a DXF file by treating expr as specifying element elem.
  • Export["file.dxf",{expr1,expr2,},{{elem1,elem2,}}] treats each as specifying the corresponding .
  • Export["file.dxf",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • Export["file.dxf",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the DXF format.


  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties and settings
  • Data representation elements:
  • "Graphics3D"DXF file represented as a Graphics3D object
    "Graphics3D"3D geometry represented as Graphics3D
    "GraphicsComplex"list of GraphicsComplex objects, each representing a geometry stored in the file
    "LineData"lines represented as lists of indices, referencing the vertices as given by the element
    "LineObjects"list of Line primitives given in absolute coordinates
    "PointData"point data in indexed form
    "PointObjects"list of Point primitives given in absolute coordinates
    "PolygonData"polygon data in indexed form
    "PolygonObjects"list of Polygon primitives given in absolute coordinates
    "VertexColors"colors associated with each vertex, given as a list of color primitives (Import only)
    "VertexData"list of vertex coordinates
  • Import and Export use the element by default for DXF files.
  • Meta-information elements:
  • "PlotRange"specifies what range of coordinates to include in the graphics
    "ViewPoint"coordinates of the view point
  • When rendering a DXF color model, Import automatically uses the setting Lighting->"Neutral".


ExamplesExamplesopen allclose all

Basic Examples  (0)Basic Examples  (0)

Scope  (3)Scope  (3)

This imports a DXF example file, rendering it as a Graphics3D object:

Click for copyable input

Import a 3D model that does not store color information:

Click for copyable input

Use SphericalPlot3D to generate a 3D geometry:

Click for copyable input

Export it to a DXF file:

Click for copyable input
Introduced in 2000
| Updated in 2007