# Select Actor Component via C++

```cpp
USelection* SelectedComps = GEditor->GetSelectedComponents();
SelectedComps->DeselectAll();
GEditor->SelectComponent(Component, true, true, true);
GEditor->NoteSelectionChange();
```

{% hint style="warning" %}
If you don't call the deselect function then it adds the component to the selection rather than exclusively selecting it.
{% endhint %}

{% hint style="info" %}
`NoteSelectionChange()` updates the gizmo in the viewport and calls appropriate delegates.
{% endhint %}
