---
title: "getRadioButtonCheck"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737756/getRadioButtonCheck"
format: markdown
---
# Description

Gets the check value of the radio button user control specified by `userControlID`.

Radio buttons are essentially check boxes, but they operate in a group with other radio buttons, allowing for mutually exclusive choices.

Call this command on each radio button in the group to see which has the checked value (if any).

## Functional area

User Window

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getRadioButtonCheck userControlID` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `userControlId` | int | yes | ID of user control to operate on. |

### Flags

None

## Return value

boolean

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Get the checked value of a Radio Button User Control
int $windowId;
int $controlId1, $controlId2, $controlId3;
int $rect[ 4 ];
 
// First create a User Window to place the Controls on
$windowId = `createWindow "MyWindow"`;
 
// Create the User Controls on the Window. Check the middle one.
$rect[ 0 ] = 20; 
$rect[ 1 ] = 20;
$rect[ 2 ] = 100;       
$rect[ 3 ] = 40;
$controlId1 = `createRadioButton $windowId -pos $rect -text "Radio 1"`;
$rect[ 1 ] = 50;
$rect[ 3 ] = 70;
$controlId2 = `createRadioButton $windowId -pos $rect -text "Radio 2" -check`;
$rect[ 1 ] = 80;
$rect[ 3 ] = 100;
$controlId3 = `createRadioButton $windowId -pos $rect -text "Radio 3"`;

// Find out which one is checked. 
if( `getRadioButtonCheck $controlId1` == true )
  {
print "Radio 1 checked";
  }
else if(`getRadioButtonCheck $controlId2` == true )
  {
print "Radio 2 checked";
  }
else if(`getRadioButtonCheck $controlId1` == true )
  {
print "Radio 3 checked";
  }
else
  { print "None checked"; 
  }  
```

> Macro (scroll-pagebreak)

# Additional information

## Related commands

- [createRadioButton](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738020)
- [setRadioButtonHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738109)