Convert to CAD formats with advanced options

GroupDocs.Conversion provides the CadConvertOptions class to specify CAD file format conversion settings. This class implements IPagedConvertOptions for page selection and IPageSizeConvertOptions for page sizing.

Supported CAD Formats

The following CAD (Computer-Aided Design) formats are recognized:

FormatExtensionDescription
DWG.dwgAutoCAD Drawing Database (binary format)
DXF.dxfDrawing Exchange Format (ASCII/binary)
DWF.dwfDesign Web Format (compressed 2D/3D)
DWFX.dwfxDesign Web Format XPS
DWT.dwtAutoCAD Drawing Template
DGN.dgnMicroStation Design File
IFC.ifcIndustry Foundation Classes (BIM)
STL.stlStereolithography (3D printing)
PLT.pltHPGL Plot File
IGS.igsIGES Drawing File
CF2.cf2Common File Format (3D package designs)

Properties

Format - Specifies the desired CAD file format. Available options are: Dwg, Dxf, Dwf, Dwfx, Dwt, Dgn, Ifc, Stl, Plt, Igs, Cf2.

PageSize - Sets the page size (A3, A4, Letter, etc.) for the output document.

PageWidth - Sets custom page width in points. When set, PageSize automatically changes to Custom.

PageHeight - Sets custom page height in points. When set, PageSize automatically changes to Custom.

PageNumber - Specifies the starting page number for conversion.

PagesCount - Specifies the number of pages to convert.

API Structure

The following example shows the API structure for CadConvertOptions:

using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;

// Create options object
CadConvertOptions options = new CadConvertOptions
{
    Format = CadFileType.Dwg,
    PageSize = GroupDocs.Conversion.Options.Convert.PageSize.A4,
    PageNumber = 1,      // Starting page
    PagesCount = 10      // Number of pages to process
};

Conversion Examples

CadConvertOptions supports conversion between CAD formats. The following examples demonstrate common conversions.

DWG to DXF

Convert an AutoCAD DWG file to DXF (Drawing Exchange Format):

using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;

string sourceFile = "drawing.dwg";
string outputFile = "drawing.dxf";

using (var converter = new Converter(sourceFile))
{
    var options = new CadConvertOptions
    {
        Format = CadFileType.Dxf
    };
    converter.Convert(outputFile, options);
}

DWG to DWF

Convert a DWG file to DWF (Design Web Format):

using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;

string sourceFile = "blueprint.dwg";
string outputFile = "blueprint.dwf";

using (var converter = new Converter(sourceFile))
{
    var options = new CadConvertOptions
    {
        Format = CadFileType.Dwf
    };
    converter.Convert(outputFile, options);
}

Page Size Options

Control output page dimensions using PageSize or custom dimensions:

Using Standard Page Size

Set a standard page size (A4, A3, Letter, etc.):

using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;

string sourceFile = "technical-drawing.dwg";
string outputFile = "technical-drawing-a4.dxf";

using (var converter = new Converter(sourceFile))
{
    var options = new CadConvertOptions
    {
        Format = CadFileType.Dxf,
        PageSize = PageSize.A4
    };
    converter.Convert(outputFile, options);
}

Using Custom Page Dimensions

Define custom page width and height in points:

using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;

string sourceFile = "floor-plan.dwg";
string outputFile = "floor-plan-custom.dxf";

using (var converter = new Converter(sourceFile))
{
    var options = new CadConvertOptions
    {
        Format = CadFileType.Dxf,
        PageWidth = 800,   // Width in points
        PageHeight = 600   // Height in points
    };
    converter.Convert(outputFile, options);
}

Format Support Notes

CAD to CAD conversions are supported for select format combinations:

  • DWG → DXF, DWF
  • DGN → DXF, DWF
  • DWT → DXF, DWF
  • STL → DXF, DWF (limited support)
  • Other CAD formats → DXF, DWF (varies by format)

Conversions from non-CAD formats (PDF, Word, Excel) to CAD formats are not supported.

Note: To convert FROM CAD formats to PDF or images, use PdfConvertOptions or ImageConvertOptions.

More Resources

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.