CAD Viewer

Created:8/6/2001
Description:

This sample provides a stand alone Visual Basic Application containing a MapControl which can be used to to view CAD data. When compiled the application can be asssociated with the most common CAD filename 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.

How to use:
  1. Build the sample into CADView.exe using Visual Basic.
  2. Edit the CADFiles.REG file replacing the 2 instances of "C:\\ArcGIS\\arcexe83\\ArcObjects Developer Kit\\Samples\\Controls\\MapControl\\CADView\\CADView.exe" with the path to your newly compiled executable.
  3. Double click on this .reg file to merge its contents into the registry. PLEASE NOTE: merging this data into the registry may overwrite existing file associations for these file types.
  4. Select any CAD file (.DXF, .DWG or .DGN) in e.g. Windows Explorer and right-click on it with the mouse.
  5. Select the 'View' option from the context menu and the application will open to display the CAD file you have selected inside the MapControl.
  6. You may now Zoom-in on the CAD Data by dragging a rectangle using the left-hand mouse button and Pan around using the right-hand mouse button.

Application:
Map Control

Requires: A Visual Basic installation, CAD data files

Minimum ArcGIS Version Required: 8.2

Difficulty: Intermediate


Visual Basic
File Description
CADView.frm CAD Viewer VB Form.
CADFiles.reg Registry Export File containing CAD file association information.


Key CoClasses: CadDrawingName, CadLayer
Key Interfaces: ICadDrawingDataset, ICadLayer
Key Members: ICadLayer::CadDrawingDataset, IDatasetName::WorkspaceName, IWorkspaceName::PathName