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

Returns an array of all the children of the specified parent.

The getChildren command is useful in script procedures for automatically identifying the children of a node or nodes. The results are saved to a module array, which may in turn be passed to a subsequent command or procedure.

## Functional area

Data retrieval

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getChildren parentName[-nodesOnly] [-fullPath] [-nameOnly]` |

### Arguments

None

### Flags

| Name | Flag arguments | Argument type | Exclusive to | Comments |
| --- | --- | --- | --- | --- |
| `nodesOnly` | 0 | — | — | — |
| `fullPath` | 0 | — | nameOnly | — |
| `nameOnly` | 0 | — | fullPath | — |

## Return value

string array 

> Macro (scroll-pagebreak)

## Examples

```plaintext
string $mods[] = `getChildren rfoot`;
int $i; 
for( $i = 0; 
   $i < $mods.getCount(); 
   $i += 1 )        
print( $mods[$i] );
print ($mods.getCount()); 
// In this example, a module array called "$mods" is declared
// and the children of the node "right_foot" are assigned to it. 
// The for loop iterates through the elements of the array and 
// prints each one to the interface. The last line prints the 
// value of $mods.getCount, which is an integer describing 
// the number of children that were found in this instance.
```

# Additional information

## Related commands

- [getModules](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736739)
- [getProperty](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737125)