View CAD data in a MapControl


PurposeThis sample provides a stand-alone application containing a MapControl that can be used to to view computer-aided design (CAD) data. When compiled, the application can be associated with the most common CAD file name extensions (.dxf, .dwg, and .dng) so that this will be the default application for opening files of these types. When opened, the application allows the user to view the data including the abilities to zoom and pan.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).

  1. Edit the CADFiles.REG file replacing the two instances of the path to the sample executable to the actual path of the sample executable on your machine, for example, C:\\Program Files\\ArcGIS\\DeveloperKit\\SamplesNET\\Engine\\MapControlCADViewer\\CSharp\\CADView.exe.
  2. Double-click this .reg file to merge its contents into the registry. Please note that merging this data into the registry may overwrite existing file associations for these file types.
  3. Select any CAD file (.dxf, .dwg, or .dgn), for example, in Windows Explorer, and right-click the file.
  4. Choose View and the application opens to display the CAD file you have selected inside the MapControl.
  5. Zoom in on the CAD data by dragging a rectangle using the left mouse button and pan around using the right mouse button.

AssemblyInfo.cs Assembly information
CADView.cs Form file
Download the C# files
AssemblyInfo.vb Assembly information
CADView.vb Form file
Download the VB.NET files

Download the files for all languages

See Also:

MapControl class
IMapControl2 interface