Eyeshot 8.0 Documentation
Quick Start
WinForms Control > Quick Start

This topic will give you a head start on creating great looking viewport for all of your Windows Forms applications.

 

Step 1 Creating a new Windows Application Project

  1. Launch Visual Studio
  2. From the File menu, select New, and then click Project
  3. In the New Project dialog box, click either Visual C# or Visual Basic from the Project types list
  4. From the Templates list, click Windows Forms Application
  5. In the Name field, replace the default project name with the name of your project

 

Step 2 Adding the control to your Form

Add the control to your Windows Form by either double-clicking on the ViewportLayout toolbox icon (installed in the 'Eyeshot Ultimate 8.0' tab of the Visual Studio toolbox), or by clicking on the icon once then "drawing" the control onto the form using the left mouse button. 

The Eyeshot viewport control in design-time mode

Figure 1: The ViewportLayout control in design-time mode.

 

Step 3 Required using/Imports statements

Add the following using/Imports statements at the beginning of the Form1.cs file.

 

using devDept.Eyeshot;
using devDept.Eyeshot.Entities;
using devDept.Geometry;
Imports devDept.Eyeshot
Imports devDept.Eyeshot.Entities
Imports devDept.Geometry

 

Step 4 Customizing the Viewport

Select the Customize ViewportLayout control item from the control Smart Tag menu to open the Visual Control Designer window.

Right-click the CoordinateSystem tree node to open the Element Designer window.

Change the Z arrow color and confirm.

 

Step 5 Drawing a box

Add the following OnLoad() override, then build and start your application.

protected override void OnLoad(EventArgs e)
{
   // Creates a mesh with the shape of a box
   Mesh m = Mesh.CreateBox(30, 20, 10);

   // Adds the mesh to the master entity collection
   viewportLayout1.Entities.Add(m, 0, Color.DarkRed);

   // Fits the drawing in the viewport
   viewportLayout1.ZoomFit();
}
Protected Override Sub OnLoad(e As EventArgs)
   ' Creates a mesh with the shape of a box
   Dim m As Mesh = Mesh.CreateBox(30, 20, 10)

   ' Adds the mesh to the master entity collection
   ViewportLayout1.Entities.Add(m, 0, Color.DarkRed)

   ' Fits the drawing in the viewport
   ViewportLayout1.ZoomFit()
End Sub

You should now see something like this:

Your first 3D drawing with Eyeshot

Figure 2: Your first 3D drawing with Eyeshot.

Navigation quick commands:

 

Step 6 Now it's your turn

Try to add more entities like points, lines, circles, triangles, etc. You'll find them in the devDept.Eyeshot.Entities namespace.

See Also

Introduction