Autodesk.Revit.DB.DXFExportOptions
The Autodesk.Revit.DB.DXFExportOptions class represents export options for exporting Revit 3D model data to AutoCAD DXF format. This class is a part of the Autodesk Revit API.
Properties
The following properties are available in the Autodesk.Revit.DB.DXFExportOptions class:
- ExportOfSolids: Specifies whether to export solids. If set to true, solids will be exported; if set to false, solids will not be exported. The default value is true.
- ExportOfMaterials: Specifies whether to export materials. If set to true, materials will be exported; if set to false, materials will not be exported. The default value is true.
- ExportOfLinePatterns: Specifies whether to export line patterns. If set to true, line patterns will be exported; if set to false, line patterns will not be exported. The default value is true.
- ExportOfTextFonts: Specifies whether to export text fonts. If set to true, text fonts will be exported; if set to false, text fonts will not be exported. The default value is true.
- ExportOfSectionViews: Specifies whether to export section views. If set to true, section views will be exported; if set to false, section views will not be exported. The default value is true.
- ExportOfFacettedData: Specifies whether to export facetted data. If set to true, facetted data will be exported; if set to false, facetted data will not be exported. The default value is true.
- ExportOfViews: Specifies the type of views to export. The possible values are "3D", "2D", "All", and "Custom". The default value is "All". If "Custom" is selected, the views to be exported can be set using the ViewId property.
- ViewId: Specifies the views to be exported when the ExportOfViews property is set to "Custom". The default value is null.
Usage
To set the export options for a DXF export, create a new instance of the Autodesk.Revit.DB.DXFExportOptions class and set the desired properties. Then pass the instance as an argument to the Document.Export method.
Example:
DXFExportOptions options = new DXFExportOptions();
options.ExportOfSolids = true;
options.ExportOfMaterials = true;
options.ExportOfLinePatterns = true;
options.ExportOfTextFonts = false;
options.ExportOfSectionViews = true;
options.ExportOfFacettedData = false;
options.ExportOfViews = "2D";
doc.Export("C:\\Temp\\exported.dxf", "exported", options);
This code exports the Revit model to a DXF file with filename "exported.dxf", file prefix "exported", and the selected export options.
Notes
- The Autodesk.Revit.DB.DXFExportOptions class can be used with both Autodesk Revit and Autodesk Revit LT.
- The supported DXF format versions are R12/R2000 and R14/R2000. If no version is specified, the default version R12/R2000 will be used.
- Some Revit elements may not be exported to the DXF file. For example, graphically overridden elements or elements with patterns not supported by DXF cannot be exported.
- The ViewId property is only applicable when the ExportOfViews property is set to "Custom". If no views are specified, the default value of null will export all views.
- The Autodesk.Revit.DB.DXFExportOptions class can also be used to export to DWG format by setting the output file extension to ".dwg".