    

 ## On this page

  

 

 # Class UserSubroutine

 Last update: 09.03.2026 

<a id="VM_Managed_DAFUL_UserSubroutine"></a>

Namespace: [VM.Managed.DAFUL](VM.Managed.DAFUL.md)  
Assembly: VMDSP.dll

This class is to represent the user subroutine.

```csharp
public class UserSubroutine : SubEntity, IObservableObject, IDisposableObject, ILinkable, ILinkContainerEvent, IVerifiable, IHistoryObjectSerializable, IAttributeContainer, ISubEntity, IEntityBase, IObjectBase, IObject, ILinkContainer, IOwned, IHasID, IEventProvider, IHasKeyObject, IHasName, IEnabled, IHasComment, INamed, INavigatorItem, IInterface, ITemplateObject, IArgument, IRepairable, IHasReportOnly, IReferencable, IReportable, IHasResult, IDuplicate

```

#### Inheritance

object ← ObservableObject ← [LinkableBase](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/Pre/Data/VM.Models.Pre/Models/LinkableBase.cs) ← ObjectBase ← Object&lt;ObjectEventCore&gt; ← [SubEntity](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs) ← [UserSubroutine](VM.Managed.DAFUL.UserSubroutine.md)

#### Implements

IObservableObject, IDisposableObject, ILinkable, ILinkContainerEvent, IVerifiable, [IHistoryObjectSerializable](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMHist/Interfaces.cs), IAttributeContainer, ISubEntity, IEntityBase, IObjectBase, IObject, ILinkContainer, IOwned, IHasID, IEventProvider, IHasKeyObject, IHasName, IEnabled, IHasComment, INamed, INavigatorItem, IInterface, ITemplateObject, IArgument, IRepairable, IHasReportOnly, IReferencable, IReportable, [IHasResult](VM.Managed.DAFUL.IHasResult.md), IDuplicate

#### Inherited Members

[SubEntity.Initialize(Unit.ConvertFactor)](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.GetModelNavigatorInformationImpl(XmlDocument, XmlElement, bool)](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.FixUp(ObjectBase)](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.WriteTemplateImpl(XmlWriter)](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.ReadTemplateImpl(XmlReader)](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.Name](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.FullName](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.NonSymmetricName](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.DisplayName](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.IsEnabled](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), [SubEntity.Comment](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMObjBase/SubEntity.cs), Object&lt;ObjectEventCore&gt;.GetKey(), Object&lt;ObjectEventCore&gt;.Initialize(Unit.ConvertFactor), Object&lt;ObjectEventCore&gt;.SetIconColor(Canvas), Object&lt;ObjectEventCore&gt;.OnDeserialization(object), Object&lt;ObjectEventCore&gt;.CustomGetObjectData(SerializationInfo, StreamingContext), Object&lt;ObjectEventCore&gt;.RollbackEvent(), Object&lt;ObjectEventCore&gt;.OnDeserializedCore(object), Object&lt;ObjectEventCore&gt;.Key, Object&lt;ObjectEventCore&gt;.UntypedEventCore, Object&lt;ObjectEventCore&gt;.EventCore, Object&lt;ObjectEventCore&gt;.Attributes, ObjectBase.ReplaceEventCore(ObjectEventCore), ObjectBase.SetModifiedCore(ModifiedResult.ModifiedType), ObjectBase.AddPostDeserialize(StreamingContext), ObjectBase.LinkAddedToDocumentCore(IOwned, bool), ObjectBase.SetModified(ModifiedResult.ModifiedType), ObjectBase.SetModified(), ObjectBase.SetModified(ModifiedResult.ModifiedType, IDocument), ObjectBase.DestroyObject(object, LinkEventArgs), ObjectBase.DestroyObject(DestroyEventArgs), ObjectBase.DestroyObject(), ObjectBase.Initialize(Unit.ConvertFactor), ObjectBase.FixUp(ObjectBase), ObjectBase.DoWorkAfterUpdateContents(), ObjectBase.SetOldNameWithNewEntity(ObjectBase, ObjectBase), ObjectBase.SetIconColor(Canvas), ObjectBase.RemoveFromCreatedList(), ObjectBase.PostAddToDocument(), ObjectBase.PostRemoveFromDocument(Document), ObjectBase.GetArgumentList(LinkedList&lt;ObjectBase&gt;), ObjectBase.ResetInvalidEntity(), ObjectBase.OnDeserialization(object), ObjectBase.IsSerializableEvent(Delegate), ObjectBase.CustomGetObjectData(SerializationInfo, StreamingContext), ObjectBase.CheckAndUpdateLink(HashSet&lt;ObjectBase&gt;), ObjectBase.Verify(VerifiedResult), ObjectBase.ConnectProxy(), ObjectBase.RollbackEvent(), ObjectBase.LinkRequestUpdating(object, LinkEventArgs), ObjectBase.LinkRequestUpdate(object, LinkEventArgs), ObjectBase.LinkRequestDestroying(object, LinkEventArgs), ObjectBase.LinkRequestDestroy(object, LinkEventArgs), ObjectBase.LinkAddedToDocument(object, AddToDocEventArgs), ObjectBase.LinkRemovedFromDocument(object, RemoveFromDocEventArgs), ObjectBase.DisposeManagedResources(), ObjectBase.GetDestroyEventExtraData(), ObjectBase.OnLinkReserved(ILink, object, EventArgs), ObjectBase.CreateEntityWhenUpdateContents(Action), ObjectBase.GetObjectByKey(UIntPtr), ObjectBase.FindObjectOnXmlDeserialize(string), ObjectBase.UpdateContents(XmlReader, ObjectBase, string), ObjectBase.UpdateContents(XmlReader, ObjectBase), ObjectBase.UpdateContents(string, string), ObjectBase.UpdateContents(string), ObjectBase.SetFlagWhenXMLFile(string, bool), ObjectBase.IsEqualArray&lt;T&gt;(T\[\], T\[\]), ObjectBase.IsEqualList(List&lt;double&gt;, List&lt;double&gt;), ObjectBase.SetContainer(IOwned, bool), ObjectBase.GetTargetListForUpdate(), ObjectBase.SkipUpdateObjectImpl(), ObjectBase.raise\_OnUpdating(object, LinkEventArgs), ObjectBase.raise\_OnUpdate(object, LinkEventArgs), ObjectBase.raise\_OnDestroying(object, LinkEventArgs), ObjectBase.raise\_OnDestroy(object, LinkEventArgs), ObjectBase.raise\_Destroying(object, Identifier), ObjectBase.raise\_OnAdded(object, AddToDocEventArgs), ObjectBase.raise\_OnRemoved(object, RemoveFromDocEventArgs), ObjectBase.raise\_OnContentsUpdated(object, EventArgs), ObjectBase.Dispose(bool), ObjectBase.SkipModified, ObjectBase.ClearChildInfoBeforeDeserialize, ObjectBase.KeyImpl, ObjectBase.ID, ObjectBase.TopologyEntityTypeName, ObjectBase.ObjectStateForCircularError, ObjectBase.ObjectState, ObjectBase.IsChildExternable, ObjectBase.IsExternable, ObjectBase.Container, ObjectBase.Owner, ObjectBase.Document, ObjectBase.UntypedEventCore, ObjectBase.KernelKey, ObjectBase.Key, ObjectBase.OnContentsUpdated, ObjectBase.OnRemoved, ObjectBase.OnAdded, ObjectBase.Destroying, ObjectBase.OnDestroy, ObjectBase.OnDestroying, ObjectBase.OnUpdate, ObjectBase.OnUpdating, [LinkableBase.OnDeserialization(object)](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/Pre/Data/VM.Models.Pre/Models/LinkableBase.cs), ObservableObject.Dispose(), ObservableObject.RaisePropertyChanged(string), ObservableObject.RaisePropertyChanged(string, object, object), ObservableObject.Dispose(bool), ObservableObject.DisposeManagedResources(), ObservableObject.DisposeUnmanagedResources(), ObservableObject.IsDisposed, ObservableObject.TryDisposing, ObservableObject.Disposed, ObservableObject.Disposing, ObservableObject.PropertyChanged

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_), [LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_), [LinkPropertyItemCache.GetLinkedObjects&lt;T&gt;(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Constructors

### <a id="VM_Managed_DAFUL_UserSubroutine__ctor"></a> UserSubroutine()

Initializes a new instance of the  class.

```csharp
public UserSubroutine()

```

### <a id="VM_Managed_DAFUL_UserSubroutine__ctor_System_String_"></a> UserSubroutine(string)

Initializes a new instance of the  class.

```csharp
public UserSubroutine(string strName)

```

#### Parameters

`strName` string

Name of the user subroutine.

## Fields

### <a id="VM_Managed_DAFUL_UserSubroutine_DefaultResultName"></a> DefaultResultName

A default name of Result.

```csharp
public const string DefaultResultName = "parameter#"

```

#### Field Value

string

## Properties

### <a id="VM_Managed_DAFUL_UserSubroutine_ArgumentList"></a> ArgumentList

Gets or sets the argument list.

```csharp
public ArgumentListGeneral ArgumentList { get; set; }

```

#### Property Value

[ArgumentListGeneral](https://github.com/AnsysVirtualMotion/DAFUL/blob/9110677a5f6a53d7604f8dfd35b4c5fceb59e8e0/DAFUL/ClassicPre/Data/VMDSB/ArgumentList.cs)

### <a id="VM_Managed_DAFUL_UserSubroutine_ArgumentType"></a> ArgumentType

Gets the type of the argument

```csharp
public ArgumentTypes ArgumentType { get; }

```

#### Property Value

ArgumentTypes

### <a id="VM_Managed_DAFUL_UserSubroutine_CommentOfArgument"></a> CommentOfArgument

Gets or sets the comment of argument.

```csharp
public string[] CommentOfArgument { get; set; }

```

#### Property Value

string\[\]

### <a id="VM_Managed_DAFUL_UserSubroutine_DllName"></a> DllName

Gets or sets the name of the DLL.

```csharp
public string DllName { get; set; }

```

#### Property Value

string

### <a id="VM_Managed_DAFUL_UserSubroutine_Expression"></a> Expression

Gets or sets the expression.

```csharp
public string Expression { get; set; }

```

#### Property Value

string

### <a id="VM_Managed_DAFUL_UserSubroutine_FunctionName"></a> FunctionName

Gets or sets the name of the function.

```csharp
public string FunctionName { get; set; }

```

#### Property Value

string

### <a id="VM_Managed_DAFUL_UserSubroutine_IsInterface"></a> IsInterface

Gets or sets a value indicating whether this instance is interface.

```csharp
public bool IsInterface { get; set; }

```

#### Property Value

bool

### <a id="VM_Managed_DAFUL_UserSubroutine_IsReportOnly"></a> IsReportOnly

Gets or sets a value indicating whether this instance is report only.

```csharp
public bool IsReportOnly { get; set; }

```

#### Property Value

bool

### <a id="VM_Managed_DAFUL_UserSubroutine_NumOfReturnValue"></a> NumOfReturnValue

Gets or sets the number of return value.

```csharp
public int NumOfReturnValue { get; }

```

#### Property Value

int

### <a id="VM_Managed_DAFUL_UserSubroutine_ReferenceType"></a> ReferenceType

Gets the type of the array for argument.

```csharp
public string ReferenceType { get; }

```

#### Property Value

string

### <a id="VM_Managed_DAFUL_UserSubroutine_ResultName"></a> ResultName

Gets or sets the name of the result.

```csharp
[Obsolete]
public string[] ResultName { get; set; }

```

#### Property Value

string\[\]

### <a id="VM_Managed_DAFUL_UserSubroutine_Results"></a> Results

Gets or sets the result.

```csharp
public UserSubroutine.Result[] Results { get; set; }

```

#### Property Value

[UserSubroutine](VM.Managed.DAFUL.UserSubroutine.md).[Result](VM.Managed.DAFUL.UserSubroutine.Result.md)\[\]

### <a id="VM_Managed_DAFUL_UserSubroutine_UserDefinedDisplaySet"></a> UserDefinedDisplaySet

Gets or sets the user defined display.

```csharp
public UserSubroutine.UserDefinedDisplay[] UserDefinedDisplaySet { get; set; }

```

#### Property Value

[UserSubroutine](VM.Managed.DAFUL.UserSubroutine.md).[UserDefinedDisplay](VM.Managed.DAFUL.UserSubroutine.UserDefinedDisplay.md)\[\]

## Methods

### <a id="VM_Managed_DAFUL_UserSubroutine_AddResult_VM_Managed_DAFUL_UserSubroutine_Result_"></a> AddResult(Result)

Add Result information.

```csharp
public void AddResult(UserSubroutine.Result result)

```

#### Parameters

`result` [UserSubroutine](VM.Managed.DAFUL.UserSubroutine.md).[Result](VM.Managed.DAFUL.UserSubroutine.Result.md)

The result.

### <a id="VM_Managed_DAFUL_UserSubroutine_AddResult"></a> AddResult()

Add result information.

```csharp
public void AddResult()

```

### <a id="VM_Managed_DAFUL_UserSubroutine_ContainsReservedArgument"></a> ContainsReservedArgument()

Determines whether \[contains\] \[the reserved arg\].

```csharp
public bool ContainsReservedArgument()

```

#### Returns

bool

`true` if \[contains\] \[the reserved arg\]; otherwise, `false`.

### <a id="VM_Managed_DAFUL_UserSubroutine_GetDefaultResultName"></a> GetDefaultResultName()

Get default result name.

```csharp
public string GetDefaultResultName()

```

#### Returns

string

### <a id="VM_Managed_DAFUL_UserSubroutine_IndexOfResult_VM_Managed_DAFUL_UserSubroutine_Result_"></a> IndexOfResult(Result)

Gets the index of result

```csharp
public int IndexOfResult(UserSubroutine.Result result)

```

#### Parameters

`result` [UserSubroutine](VM.Managed.DAFUL.UserSubroutine.md).[Result](VM.Managed.DAFUL.UserSubroutine.Result.md)

The result

#### Returns

int

### <a id="VM_Managed_DAFUL_UserSubroutine_Initialize_VM_Unit_ConvertFactor_"></a> Initialize(ConvertFactor)

Initializes member through unit convert factor.

```csharp
public override void Initialize(Unit.ConvertFactor factor)

```

#### Parameters

`factor` Unit.ConvertFactor

The unit convert factor.

### <a id="VM_Managed_DAFUL_UserSubroutine_IsContainResultName_System_String_"></a> IsContainResultName(string)

Is contain result name.

```csharp
public bool IsContainResultName(string name)

```

#### Parameters

`name` string

#### Returns

bool

### <a id="VM_Managed_DAFUL_UserSubroutine_ModifyArgumentListWithExpression_System_String_"></a> ModifyArgumentListWithExpression(string)

Modify argumentList with expression

```csharp
public void ModifyArgumentListWithExpression(string strExpression)

```

#### Parameters

`strExpression` string

### <a id="VM_Managed_DAFUL_UserSubroutine_ModifyResultsCount_System_Int32_"></a> ModifyResultsCount(int)

Modify Result information.

```csharp
public void ModifyResultsCount(int resultsCount)

```

#### Parameters

`resultsCount` int

The result count.

### <a id="VM_Managed_DAFUL_UserSubroutine_OnDeserialization_System_Object_"></a> OnDeserialization(object)

Called when \[deserialization\].

```csharp
protected override void OnDeserialization(object sender)

```

#### Parameters

`sender` object

The sender.

### <a id="VM_Managed_DAFUL_UserSubroutine_ReadTemplateImpl_System_Xml_XmlReader_"></a> ReadTemplateImpl(XmlReader)

Reads the template document \[implementation\].

```csharp
protected override void ReadTemplateImpl(XmlReader reader)

```

#### Parameters

`reader` XmlReader

The reader.

### <a id="VM_Managed_DAFUL_UserSubroutine_WriteTemplateImpl_System_Xml_XmlWriter_"></a> WriteTemplateImpl(XmlWriter)

Writes the template document \[implementation\].

```csharp
protected override void WriteTemplateImpl(XmlWriter writer)

```

#### Parameters

`writer` XmlWriter

The writer.