Create Line Parallel Edit ControlCognex VisionPro

This topic contains the following sections.

The Create Line Parallel edit control provides a graphical user interface to the CreateLineParallel method, which creates a new line that is parallel to Line on the point (X, Y). The edit control allows you to configure the line and the point, dictate which graphics appear as the tool executes, and view tool results. The following figure shows the Create Line Parallel edit control:

Cognex Dimensioning Create Line Parallel Control Create Line Parallel Whole Control

The edit control offers the following features:

  • A row of control buttons at the top left
  • A set of function tabs to define the line and the point, choose what graphics the tool will use, and view results
  • An image display window for displaying tool images and graphics

You can experiment with the edit control by using QuickBuild to create a CogCreateLineParallel tool. A new CogCreateLineParallel tool appears as shown in the following figure:

Cognex Dimensioning Create Line Parallel Control Create Line Parallel Terminals

To include the edit control in your custom vision application, you must first add it to your Visual Studio.NET development environment. See Using Edit Controls in Your Custom Vision Applications for more information.

Control Buttons

Cognex Dimensioning Create Line Parallel Control MTWButton Bar

The following table describes the function of each button:

Table 1. Control buttons
ButtonDescriptionFunction
Run Button
RunCreates a new line on the input point parallel to the input line
Electric Button
Electric modeToggles electric mode, where the Create Line Parallel tool executes automatically when particular configuration parameters change. In electric mode, a lightning bolt appears next to every electric property

Local Display Button

Local image display

Opens or closes the local image display window. A Create Line Parallel tool supports the following image buffers:

  • The Current.InputImage buffer contains the current image and the input point and input line
  • The LastRun.InputImage buffer contains the results of the tool after it creates a parallel line on the input point
Floating Display Button
Floating image displayOpens one or more floating image windows, which support the same image buffers as the local image display window
Open Button
OpenOpens a VisionPro persistence (.vpp) file that contains a set of saved properties for this vision tool object type. VisionPro reports an error if you try to open a .vpp file for another object type.
Save Button
SaveSaves the current properties of the vision tool to a VisionPro persistence (.vpp) file. The edit control allows you to choose between saving the vision tool with or without its image buffers and tool results.
Save As Button
Save AsSaves the current properties of the vision tool to a new VisionPro persistence (.vpp) file
Reset Button
ResetResets the vision tool to its default state.
Tool Tips Button
Show ToolTipsEnables or disables the display of tooltips for individual items in the edit control
Help Button
HelpOpens this VisionPro online help file
Settings Tab

Use the Settings tab to define the input point and input line. The following figure shows the Settings tab:

Cognex Dimensioning Create Line Parallel Control Create Line Parallel Settings Tab

The Settings tab offers the following features for defining the point (X, Y):

Table 2. Settings tab
FeatureDescription
X and YThe (x, y) coordinate of the reference point on which the tool creates the parallel line

The Settings tab offers the following features for defining Line:

Table 3. Settings tab
FeatureDescription
SelectedSpaceNameNames the coordinate space for the line shape
XThe x-coordinate of the reference point on the line
YThe y-coordinate of the reference point on the line
RotationThe angle of the line
FitToImageCenters the line within the Current.InputImage

With the Output drawing style section, you can control the appearance of the output shape that is drawn on the image. See the controls and the example below.

Table 4. Settings tab
FeatureDescription
OutputColorThe output shape color
OutputLineWidthInScreenPixelsThe line width of the output shape
OutputLineStyleThe line style of the output shape

Cognex Dimensioning Create Line Parallel Control Create Line Parallel Output Shape

Graphics Tab

Use the Graphics tab to control which graphics the Create Line Parallel tool generates and displays. The following figure shows the Graphics tab:

Cognex Dimensioning Create Line Parallel Control Create Line Parallel Graphics Tab

The Graphics tab offers the following features:

Table 5. Graphics tab
FeatureDescription
Show Input ImageDetermines whether or not the input image is recorded as part of the diagnostic record, and whether the image is copied to the record or saved in the record as a reference
Show PointShow the input point in the LastRun.InputImage buffer
Show LineShow the input line in the LastRun.InputImage buffer
Show Output LineShow the line that runs through the input point and runs parallel to the input line
Results Tab

Use the Results tab to view results of the parallel line that runs through the input point. The following figure shows the Results tab:

Cognex Dimensioning Create Line Parallel Control Create Line Parallel Results Tab

The Results tab offers the following features:

Table 6. Results tab
FeatureDescription
Selected Space NameNames the coordinate space for the output image
XThe x-coordinate of the reference point through which the tool creates a line parallel to the input line
YThe y-coordinate of the reference point through which the tool creates a line parallel to the input line
RotationThe angle of the line