Diagram / Import and Export / Import / AutoCAD Drawing Interchange (DXF) Import
In This Topic
    AutoCAD Drawing Interchange (DXF) Import
    In This Topic

    There are two ways to import an AutoCAD drawing (in DXF format): as a document and as an image.

     Import an AutoCAD Drawing as a Document

    Importing an AutoCAD drawing as a document creates a new document and then imports the AutoCAD drawing in it:

    Import an AutoCAD DXF Drawing as document
    Copy Code
    drawingView.LoadFromLocalFile(@"D:\Documents\AutoCadDrawing.dxf");
    
     Import an AutoCAD Drawing as an Image

    Importing an AutoCAD drawing as an image just creates a new shape and sets the imported AutoCAD drawing as its image and preserves all content currently in the drawing.

    Import an AutoCAD DXF Drawing as image
    Copy Code
    NImage image = NImage.FromFileEmbedded(@"D:\Documents\AutoCadDrawing.dxf");
    NPoint imageCenter = new NPoint(300, 300);
    NInsertImageCommandAction.InsertImage(drawingView, imageCenter, image);
    

     

    See Also