> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Miscellaneous

## Classes

| Type | Name |
| - | - |
| class | [RealList](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_real_list.md) a convenience class for Lua (std::list\<number>) |

## Functions

| Type | Name |
| - | - |
| string | [currentScriptPath](#gae50275197090093dde0b291bba13ed6d) () Determines the current directory of the the currently running script file. |
| | [loadMacros](#gac2e3aa62e39e5a82dd1f3b2bddc1fe41) (macro::MacroManager macroManager) Load macros stored at the [MacroManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_macro_manager.md). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call: |
| | [loadMacros](#gacc1f94f24e8a810977c3d4d8c7c0a0b9) () Load macros stored at the [MacroManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_macro_manager.md) of the current sos.database(). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call: |
| | [log](#gac54ef505f435c0792a201496df7ac71a) (string message) Issues an info log message. |
| | [log](#gaf74ccfa3835ac7064c7b8548b805e848) (number level, string message) Issues a log message to the SoS logger. |
| | [setLogLevel](#gad03ab6943f70cf074ab3c4968f391dee) (number level=3, int log\_id=-1) sets the verbose level of the logger |
| | [setMaxNumThreads](#ga1446974842fc22f6562c679a6b168391) (number numthreads) Sets the maximum number of threads used in OpenMP. |
| bool | [useCommandLogFile](#gaee56115d53407a868281c97b9c8a3daa) (bool usage=true) Controls the usage of SoS's command log file. |

## Detailed Description

## Function Documentation

### currentScriptPath()

```cpp theme={null}
string currentScriptPath()
```

Determines the current directory of the the currently running script file.

The method uses the global interpreter() function to access the Lua state.

**Returns**

The current directory of the script being processed at the moment.

**Exceptions**

| Name | Description |
| - | - |
| An | exception if the current script is not a file |

### loadMacros() \[1/2]

```cpp theme={null}
loadMacros(macro::MacroManager macroManager)
```

Load macros stored at the [MacroManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_macro_manager.md). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call:

sos\_macros.getNodeMin(sos.database(), "1", 'TEMP', 'min\[TEMP]')

**Parameters**

| Name | Description |
| - | - |
| macroManager | A reference to the [MacroManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_macro_manager.md). All the macroManager's macros are loaded. |

### loadMacros() \[2/2]

```cpp theme={null}
loadMacros()
```

Load macros stored at the [MacroManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_macro_manager.md) of the current sos.database(). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call:

sos\_macros.getNodeMin(sos.database(), "1", 'TEMP', 'min\[TEMP]')

### log() \[1/2]

```cpp theme={null}
log(string message)
```

Issues an info log message.

**Parameters**

| Name | Description |
| - | - |
| message | The info log message |

### log() \[2/2]

```cpp theme={null}
log(
    number level,
    string message
)
```

Issues a log message to the SoS logger.

**Parameters**

| Name | Description |
| - | - |
| level | Defines the log level. Accepts values between \[1-5] as well as their corresponding enum values - 1 / logger.ERROR .. error - 2 / logger.WARNING .. warning - 3 / logger.INFO .. info - 4 / logger.DEBUG .. debug - 5 / logger.TRACE .. trace |
| message | The log message itself |

**Exceptions**

| Name | Description |
| - | - |
| In | case of unknown log level |

### setLogLevel()

```cpp theme={null}
setLogLevel(
    number level = 3,
    int log_id = -1
)
```

sets the verbose level of the logger

**Parameters**

| Name | Description |
| - | - |
| level | defines the new log level |
| log\_id | Gives the Id of the logger to set the level for. If omitted all loggers maintained get the same level The following levels exist: - 0 .. no output - 1 .. only errors - 2 .. like 1 + warnings - 3 .. like 2 + info (default) - 4 .. like 3 + debug info - 5 .. like 4 + trace info |

### setMaxNumThreads()

```cpp theme={null}
setMaxNumThreads(number numthreads)
```

Sets the maximum number of threads used in OpenMP.

**Parameters**

| Name | Description |
| - | - |
| numthreads | the number of threads |

> [!NOTE]
>
> Does not have any action if OpenMP is disabled.

### useCommandLogFile()

```cpp theme={null}
bool useCommandLogFile(bool usage = true)
```

Controls the usage of SoS's command log file.

**Parameters**

| Name | Description |
| - | - |
| usage | Set to true (default) if a command log file is desired. False otherwise |

**Returns**

The previous state

> [!NOTE]
>
> The command log file will be updated each time the lua interpreter is about to start the execution of a new line of code. This means the physical command log file will be rewritten for EACH LINE! In consequence, at least if there is any change that your loop might get huge for some input, you're strongly advised to switch command log file support off immediately before entering the loop and to reanable it afterwards
