The Autodesk.Revit.DB.DWGExportOptions
is a class in the Revit API used for specifying the options for exporting a Revit model to a DWG file.
The following export options are available to configure using the DWGExportOptions
class:
This class should be used in combination with the Document.Export
method to export Revit models to DWG files, with a code sample below:
DWGExportOptions dwgOptions = new DWGExportOptions();
// Set options for the DWG Export
dwgOptions.ExportOfSolids = true;
dwgOptions.LayerMapping = LayerMapping.ByCategory;
// Export the model
doc.Export(exportPath, "DWG", dwgOptions);
The following properties are available to configure using the DWGExportOptions
class:
ExportOfSolids
: True
to export all solids defined by the model, or False
to export only the outer surfaces of the solid geometry.ExportOfMappedItems
: True
to export only the items that are visible in the view, or False
to export all items.ExportOfPatterns
: True
to export patterns which are part of the model, or False
to export them as lines.ExportOfMaterials
: True
to export material information, or False
to export basic color information instead.LayerMapping
: The type of layer mapping to use, either ByEntity
or ByCategory
.CoordinateSystem
: The coordinate system to export the DWG file in, either the shared coordinate system, the project coordinate system, or the internal coordinate system.LineScaling
: The scaling factor for line patterns.ExportOfHatches
: True
to export hatches, or False
to export them as lines.ExportOfImages
: True
to export images, or False
to export them as reference files.ExportOfTransparency
: True
to export transparency, or False
to export opaque fills.The Autodesk.Revit.DB.DWGExportOptions
class is a powerful tool for configuring the export of Revit models to DWG files. By adjusting the available options to match the needs of a specific project, users can ensure accurate, high-quality exports with minimal effort.