ImageGear .NET v25.2 - Updated
Developer Guide / How to Work with... / CAD / How To ... / Load a CAD File
In This Topic
    Load a CAD File
    In This Topic

    Loading a CAD file

    The following sample code demonstrates how to load a CAD file using ImageGear.

    C#
    Copy Code
    using System.IO;
    using ImageGear.Formats;
    using ImageGear.Formats.CAD;
    
    public static void LoadACadFile(string path)
    {
        ImGearCADPage page = null;
    
        // Load the file.
        using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
        {
            page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
        }
    }
    
    VBV.NET
    Copy Code
    Imports System.IO
    Imports ImageGear.Formats
    Imports ImageGear.Formats.CAD
    
    Public Sub LoadACadFile(path As String)
        Dim page As ImGearCADPage
    
        ' Load the file.
        Using fileStream As New FileStream(path, FileMode.Open, FileAccess.Read)
            page = ImGearFileFormats.LoadPage(fileStream)
        End Using
    End Sub
    

    Saving a CAD File as Other Supported Formats

    See Convert ... for more information.