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

Returns all namespaces to the left of the module name as a string array, with an element for each space name.

All modules under the same parent can be considered in the namespace of that parent, using slashes ( / ) to separate each module's parent's name. getNamespaces operates on all selected modules unless you use the `-onMod` flag to specify the module on which to operate by name.

Note that you may specify the path in commands that require a module name, but you may not specify the path as a module name in the `Name` attribute.

You need to specify only what is required to uniquely identify the name.

## Functional area

Namespace

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getNamespaces [-onMod string]` |

### Arguments

None

### Flags

| Name | Flag arguments | Argument type | Exclusive to | Comments |
| --- | --- | --- | --- | --- |
| `onMod` | 1 | string | — | Specifies the module on which the command operates. |

## Return value

string array 

> Macro (scroll-pagebreak)

## Example

```plaintext
 // Print a namespace array returned by the getNamespaces command 
string$namespace[]=`getNamespaces`;
print$namespace; 
```

# Additional information

## Related commands

- [addNamespace](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736602)
- [getNamespace](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736535)
- [removeNamespace](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737568)
- [replaceNamespace](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738377)