This article explains how to create a new Visual Studio project that uses the Eyeshot Viewport.
Creating a new Windows Application Project
- Launch Visual Studio
- From the File menu, select New, and then click Project
- In the New Project dialog box, click either Visual C# Projects or Visual Basic Projects from the Project types list
- From the Templates list, click Windows Application
- In the Name field, replace the default project name with the name of your project
Adding the Eyeshot control to Visual Studio Toolbox
- Download the appropriate installation file
- Install the product on your PC
- Open Visual Studio and Expand the Toolbox
- Drag and drop the devDept.EyeshotProfessional.dll file onto the Toolbox window. The file is located in the Bin installation folder (c:\Program Files\devDept Software\Eyeshot Professional).
The Visual Studio Toolbox should now look like this:

Figure 1: The Visual Studio toolbox window with the Eyeshot control installed.
Adding the Eyeshot Viewport to Form1
Open the Visual Studio Toolbox and drag and drop the ViewportProfessional item on the Form1 surface.
Required using/Imports statements
Add the following using/Imports statements at the beginning of the Form1.cs file.
| C# | Copy Code |
|---|---|
|
using devDept.Eyeshot; using devDept.Eyeshot.Standard; using devDept.Eyeshot.Geometry; | |
| Visual Basic | Copy Code |
|---|---|
|
Imports devDept.Eyeshot Imports devDept.Eyeshot.Standard Imports devDept.Eyeshot.Geometry | |
Adding the Load event handler to Form1
From the Form1 properties window switch to Events and double-click the Load event, the Form1_Load() method will be added to the Form1 class.
Drawing a rectangular face
Add the following lines to the Form1_Load() method, then build and start your application. The RescaleModel() method has to be called every time you finish adding/removing entities to fit the model inside a unit sphere. Without this call you'll probably not see the model at all.
| C# | Copy Code |
|---|---|
|
private void Form1_Load(object sender, EventArgs e) { viewportProfessional1.Entities.Add( new Quad( 0, 0, 0, // first vertex 100, 0, 0, // second vertex 100, 80, 0, // third vertex 0, 80, 0, // fourth vertex Color.DarkOrange)); // Sets edge color as entity color viewportProfessional1.EdgeColorMode = Viewport.edgeColorType.byEntityColor; // Fits the model in a unit sphere viewportProfessional1.RescaleModel(); // Sets isometric view viewportProfessional1.IsoView(); } | |
| Visual Basic | Copy Code |
|---|---|
|
Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ViewportProfessional1.Entities.Add( _ New Quad( _ 0, 0, 0, _ ' first vertex 100, 0, 0, _ ' second vertex 100, 80, 0, _ ' third vertex 0, 80, 0, _ ' fourth vertex Color.DarkOrange)) ' Sets edge color as entity color ViewportProfessional1.EdgeColorMode = Viewport.edgeColorType.byEntityColor ' Fits the model in a unit sphere ViewportProfessional1.RescaleModel() ' Sets isometric view ViewportProfessional1.IsoView() End Sub | |
You should now see something like this:

Figure 2: Your first 3D drawing with Eyeshot.
Use the middle mouse button combined with Ctrl or Shift keys to Zoom/Pan/Rotate.
For your convenience you may want to rename viewportProfessional1 as eyeshotView1.
Now it's your turn
Try to add more entities like points, lines, circles, triangles, etc. You'll find them in the devDept.Eyeshot.Standard namespace.