---
title: "getNamespace"
canonical: "https://help.vicon.com/space/Shogun17/13536567/getNamespace"
format: markdown
---
# Description

Returns all namespaces to the left of the module name as a single string.

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. getNamespace 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.

Also note that getNamespace returns all namespaces to the left of the module name as a single string, for example, if run on the namespace Joe:Bill:LFHD then Joe:Bill is returned.

## Functional area

Namespace

# Command syntax

## Syntax

|  |
| --- |
| `getNamespace [-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 

> Macro (scroll-pagebreak)

## Example

```plaintext
// Print a namespace returned by the getNamespace command 
string$namespace=`getNamespace`;
print$namespace;
```

# Additional information

## Related commands

- [addNamespace](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537752)
- [getNamespaces](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536581)
- [removeNamespace](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536950)
- [replaceNamespace](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537014)