# How to select the object and get its unique ID in VTK VB.net?

**URL:** https://discourse.vtk.org/t/how-to-select-the-object-and-get-its-unique-id-in-vtk-vb-net/10655
**Category:** Support
**Created:** [February 10, 2023, 1:06pm UTC](https://discourse.vtk.org/t/how-to-select-the-object-and-get-its-unique-id-in-vtk-vb-net/10655 "2023-02-10T13:06:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ahmed\_Anas](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ahmed_anas/32/6534_2.png) [@Ahmed\_Anas](https://discourse.vtk.org/u/Ahmed_Anas)
#### Post date: [February 10, 2023, 1:06pm UTC](https://discourse.vtk.org/t/how-to-select-the-object-and-get-its-unique-id-in-vtk-vb-net/10655/1 "2023-02-10T13:06:31Z")

</div>

Lets say I have an object i.e. vtkLineSource. I have drawn it using the code.

```
    Public Sub CreateLine(x1 As Double, y1 As Double, z1 As Double,
                      x2 As Double, y2 As Double, z2 As Double,
                      color As Color, renderer As Kitware.VTK.vtkRenderer)
    Dim line As New vtkLineSource
    line.SetPoint1(x1, y1, z1)
    line.SetPoint2(x2, y2, z2)

    '// Visualize
    Dim mapper As vtkPolyDataMapper = New vtkPolyDataMapper
    mapper.SetInputConnection(line.GetOutputPort())
    mapper.SetColorMode(122)

    Dim actor As vtkActor = New vtkActor
    actor.SetMapper(mapper)
    actor.GetProperty().SetLineWidth(2)
    actor.GetProperty.SetColor(color.R, color.G, color.B)

    'renderer.SetBackground(0.2, 0.3, 0.4)
    renderer.AddActor(actor)
End Sub

```

Now i want to select this line by clicking on it. How it can be done?
