AddLine Method

NI Vision for Visual Basic

AddLine Method

Syntax

CWIMAQRegions.AddLine Line

Return Type

CWIMAQRegion

The region object that was added.

Purpose

Adds a line region to the regions collection.

Remarks

This method makes a copy of the input line.

Parameters

Line As CWIMAQLine

The line to add.

Example

Private Sub Run_Click()
    'Create a line
    Dim Line As New CWIMAQLine
    Line.Initialize 25, 150, 150, 25
    
    'Add the line to the viewer's regions collection.
    CWIMAQViewer1.Regions.AddLine Line

    If TypeName(Line) = "Nothing" Then
    MsgBox "Number of lines exceeded!"
    Else
    MsgBox "You added a line." 
    End If

End Sub