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

# Class UserSubroutineAPI

Namespace: [VM.API.Pre](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.API.Pre)\
Assembly: VM.API.Pre.dll

This class implements APIs for [UserSubroutine](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Managed.DAFUL.UserSubroutine.md) class.

```csharp theme={null}
public static class UserSubroutineAPI
```

#### Inheritance

object ←
[UserSubroutineAPI](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.API.Pre.UserSubroutineAPI.md)

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkedObjects\<T>(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Methods

### CreateUserSubroutine(SubSystemDocument, string, string, string, IEnumerable\<UserSubroutineResult>, IEnumerable\<Obj>, string, bool, SymmetricType, bool)

Create [UserSubroutine](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Managed.DAFUL.UserSubroutine.md).

```csharp theme={null}
[NotNull(new string[] { "document" })]
[NotNullOrEmpty(new string[] { "functionName", "dllName" })]
public static Obj CreateUserSubroutine(this SubSystemDocument document, string functionName, string dllName, string parameter = "", IEnumerable<UserSubroutineResult> results = null, IEnumerable<Obj> arguments = null, string name = "", bool isReportOnly = true, SymmetricType symmetricType = SymmetricType.None, bool isInterface = false)
```

#### Parameters

`document` [SubSystemDocument](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMDFBase/SubSystemDocument.cs)

The document to create a user subroutine.

`functionName` string

The function name of a user subroutine.

`dllName` string

The dll name of the user subroutine. the input file type is 'dll' or 'so'.

`parameter` string

The parameter of a user subroutine..

`results` IEnumerable\<[UserSubroutineResult](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.API.Pre.UserSubroutineResult.md)>

The results of a user subroutine.

`arguments` IEnumerable\<[Obj](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.API.Pre.Obj.md)>

The expressions of a user subroutine..

`name` string

The name of a user subroutine.

`isReportOnly` bool

'true' if it is report Only. Otherwise, 'false'.

`symmetricType` SymmetricType

The symmetric type of the new [UserSubroutine](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Managed.DAFUL.UserSubroutine.md)

`isInterface` bool

'true' if it is interface body. Otherwise, 'false'.

#### Returns

[Obj](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.API.Pre.Obj.md)

The new [UserSubroutine](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Managed.DAFUL.UserSubroutine.md) object that is created by this API.

#### Exceptions

ArgumentNullException

Will be thrown if 'document', 'functionName', 'dllName' argument is null.

ArgumentException

Will be thrown if the extension of 'dllName' is not 'dll', 'so'.

ArgumentException

Will be thrown if the type of 'arguement' is not [IArgument](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.IArgument.md).
