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

Selects all modules with matching name(s).

Names can contain DOS-style wild card characters to select modules matching name patterns. The wild card character ? matches any single character, while * matches zero or more characters.

Thus, the following command selects all markers whose name began with L (usually indicating they are on the left of the body):

```plaintext
selectByName "L*" -type "Marker"; 
```

Unlike the [select](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737508) command which selects only the first module with the given name if multiple modules of the same name exist, the selectByName command selects all modules of the given name.

> ✅ **String arrays**  
> ✅ In Shogun 1.14 and later, you can use an array of marker names as an input argument, in addition to a single string input (see final example in [Examples](#selectByNameExamples)).

## Functional area

Selection

> Macro (scroll-pagebreak)

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `selectByName "name1" "name2" ...[-a] [-r] [-type string] [-childOf string]` |

### Arguments

> Macro (scroll-tablelayout)

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `name1` | string | no | One or more module names to select. The name can contain DOS-style wild card characters to match name patterns. If no names are specified, all modules are de-selected. |

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag**  
**arguments** | **Argument**  
**type** | **Exclusive**  
**to  ** | **Comments** |
| --- | --- | --- | --- | --- |
| `a` | 0 | — | r | Specifies that selection operation add to the current scene selection. The default is to replace the scene selection. |
| `r` | 0 | — | a | Specifies that selection operation be removed from the current scene selection. The default is to replace the scene selection. |
| `type` | 1 | string | — | Narrows the search to specific module types (e.g. Bone, Marker, etc.). The default is all module types. |
| `childOf` | 1 | string | — | Only selects modules that are children of this module name. |

## Return value

void

> Macro (scroll-pagebreak)


    > Macro (anchor)




## Examples

```plaintext
// Select all head markers in the scene, not just the
// one under the priority search module
selectByName "LFHD" "RFHD" "LBHD" "RBHD";
 
// Could have also done this
selectByName "*HD";
 
// Add to the selection all front waist markers
selectByName "?FWT" -a;

//Use a string array as input
string $names[3];
$names[0] = "RShoulder";
$names[1] = "LShoulder";
$names[2] = "LHip";

selectByName $names;
```

# Additional information

## Related commands

- [select](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737508)
- [selectabilityOn](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737978)
- [selectBranch](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737247)
- [selectByPart](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736482)
- [selectBySide](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738001)
- [selectByType](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737710)
- [selectChildren](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738333)
- [selectParent](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737538)
- [selectSet](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737834)
- [selectTree](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736558)
- [setPrimary](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736466)