- Viewer demo
Viewer library
-------------
The Viewer library provides functionality for viewing CAD files, Windows metafiles and raster images. The supported formats include DWG, DXF, WFM, EMF, BMP, JPG, TIFF, GIF, and ICO. The program allows converting CAD files to Windows metafiles and raster images. Raster images can be printed, zoomed in, zoomed out and rotated in their planes. For CAD images the program provides a wider scope. They also can be printed, zoomed in and zoomed out.
Rotation for them is possible around each of three space axes. Each layer of the CAD image can be switched off or switched on. Different layouts can be selected in the corresponding combo box. A visibility of all entities contained in the CAD file can be switched off or switched on. The program also allows turning on or turning off SHX fonts.
Other features include:
* Supporting three-dimensional coordinates;
* Supporting nested extrusions;
* Easy and multifarious image scaling and dragging;
* Compatible with AutoDesk DXF Release 10, 12, 13, 14, 2000, 2002, 2004/2005/2006;
* Compatible with AutoDesk DWG Release 9, 10, 12, 13, 14, 2000, 2002, 2004/2005/2006;
* Fully compatible with C#, VB.NET and other programming environments;
* Using Unicode to view Japanese, Chinese, Korean and other hieroglyphs;
* Supporting a DXF AutoCAD Table;
* Supporting DXF and DWG reference images.
Another remarkable feature of the CADImport.NET library is CADImportControl component. This control makes possible inserting the whole CAD viewer to any Windows form.
To use CADImportControl create a new Windows application. Add respective name spaces in the project:
// code example:
using CADImport;
using CADImportControl;
Add three lines of code to the constructor of the main application's form:
// code example:
CADImportControl.CADImportControl importControl = new CADImportControl.CADImportControl();
importControl.Size = new Size( this .ClientRectangle.Width, this .ClientRectangle.Height); this .Controls.Add(importControl);
Run the application and you will receive a completely functional AutoCAD viewer on your form.
Import library
--------------
The Import library besides the features of the first library also provides a full access to all entities read from a CAD file. This feature allows a programmer to modify the properties of each entity loaded from a CAD file by code. All entities from a CAD file also can be imported to the application and saved in the following text format:
ClassName = CADImport.CADLINE; Entity name = LINE layer = 0 style = psSolid color = ffff00ff Begin point:
X=314,02877557061 Y=260,650719629539 Z=0 End point:
X=347,350258688998 Y=227,50439611107 Z=0 ClassName = CADImport.CADLINE; Entity name = LINE layer = 0 style = psSolid color = ffff00ff Begin point:
X=402,649741311002 Y=172,49560388893 Z=0 End point:
X=412,575289473926 Y=162,622230925982 Z=0 ClassName = CADImport.CADTEXT; Entity name = TEXT layer = 0 style = psSolid color = ffff00ff Start point of
Text:
X=463,963052226108
Y=189,239334106445
Z=0
The text is: 90B0 Angle=090
All basic entity properties are represented here. For the line these are name, layer, style, color, beginning point, end point. For the text entity its contents is also included as a property.