ImageGear .NET - Updated August 31, 2018
CAD to Stacked SVG
User Guide > How to Work with... > CAD > How To ... > Convert ... > CAD to Stacked SVG

The following CADtoStackedSVG sample illustrates how you can create a stacked SVG from a CAD page:

C#
Copy Code
using System.IO;
using ImageGear.Formats;
using ImageGear.Formats.CAD;

public static void CadToStackedSvg(string inFile, string outFile)
{
    ImGearCADPage page = null;

    // Load the file.
    using (FileStream fileStream = new FileStream(inFile, FileMode.Open, FileAccess.Read))
    {
        page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
    }

    // Save the CAD file to a Stacked SVG file.
    page.SaveOptions["StackedSVG"] = true;

    using (FileStream fileStream = new FileStream(outFile, FileMode.Create, FileAccess.Write))
    {
        ImGearFileFormats.SavePage(page, fileStream, ImGearSavingFormats.SVG);
    }
}