    

 ## On this page

  

 

 # Class SwitchableBodyAPI

 Last update: 09.03.2026 

<a id="VM_API_Pre_SwitchableBodyAPI"></a>

Namespace: [VM.API.Pre](VM.API.Pre.md)  
Assembly: VM.API.Pre.dll

This class implements APIs for  class.

```csharp
public static class SwitchableBodyAPI

```

#### Inheritance

object ← [SwitchableBodyAPI](VM.API.Pre.SwitchableBodyAPI.md)

#### 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_)

## Methods

### <a id="VM_API_Pre_SwitchableBodyAPI_CreateSwitchableBody_VM_Managed_DAFUL_SubSystemDocument_System_Collections_Generic_IEnumerable_VM_API_Pre_Obj__System_Nullable_VM_API_Pre_Obj__System_String_VM_Managed_SymmetricType_"></a> CreateSwitchableBody(SubSystemDocument, IEnumerable&lt;Obj&gt;, Obj?, string, SymmetricType)

Create

```csharp
[NotNull(new string[] { "doc", "bodies" })]
public static Obj CreateSwitchableBody(this SubSystemDocument doc, IEnumerable<Obj> bodies, Obj? selectedBody = null, string name = "", SymmetricType symmetricType = SymmetricType.None)

```

#### Parameters

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

The  to create a switchable body.

`bodies` IEnumerable&lt;[Obj](VM.API.Pre.Obj.md)&gt;

The connectable bodies of a switchable body.

`selectedBody` [Obj](VM.API.Pre.Obj.md)?

The selected connectable body of a switchable body.

`name` string

The name of a switchable body.

`symmetricType` SymmetricType

The symmetric type of the new .

#### Returns

[Obj](VM.API.Pre.Obj.md)

The new  object that is created by this API.

#### Exceptions

ArgumentNullException

Will be thrown if 'doc', 'bodies' argument is null.

ArgumentException

Will be thrown if the type of 'bodies', 'selectedBody' is not .

ArgumentException

Will be thrown if the element of 'bodies' does not contain 'selectedBody'.