Skip to main content

Motion Standalone Preprocessor C# library 2026 R1

Class SolidBodyAPI

Last update: 09.03.2026

Namespace: VM.API.Pre
Assembly: VM.API.Pre.dll

This class implements APIs for class.

public static class SolidBodyAPI

Inheritance

object ← SolidBodyAPI

Extension Methods

LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType), LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType), LinkPropertyItemCache.GetLinkedObjects<T>(object, LinkPropertyType)

Methods

ChangeSolidBodyAnalysisSetting(Obj, BodyAnalysisType)

Change the analysis setting of solid body.

[NotNullObj(new string[] { "solidBody" })]
[MatchTypeObj(new object[] { "solidBody", typeof(SolidBody) })]
public static void ChangeSolidBodyAnalysisSetting(this Obj solidBody, BodyAnalysisType type)

Parameters

solidBody Obj

The solid body to be changed.

type BodyAnalysisType

The body analysis type to be changed.

Exceptions

ArgumentNullException

Will be thrown if 'solidBody' arguments are empty.

ArgumentException

Will be thrown if 'solidBody' argument is not empty and type of 'solidBody' is not .

CreateMarker(Obj, TMatrix, string, SymmetricType)

Create at the given

[NotNullObj(new string[] { "body" })]
public static Obj CreateMarker(this Obj body, TMatrix transform, string markerName = "", SymmetricType symmetricType = SymmetricType.None)

Parameters

body Obj

The to create a marker.

transform TMatrix

The transformation matrix for a marker.

markerName string

The name of the marker. If empty, default name starts with 'MK_' will be generated and used.

symmetricType SymmetricType

The symmetric type

Returns

Obj

the new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'solidBody' is null.

CreateMeshFile(Obj, string, string, bool, bool, bool, string, FacetParameters?)

Generate mesh file with given entity.

[NotNullObj(new string[] { "body" })]
[NotNullOrEmpty(new string[] { "pathMeshFile" })]
public static Obj CreateMeshFile(this Obj body, string pathMeshFile, string nodalBodyName = "", bool importMeshAfterCreate = true, bool addToModel = true, bool createGroup = false, string groupName = "", FacetParameters? facetParameters = null)

Parameters

body Obj

The to generate mesh file.

pathMeshFile string

Generated mesh file path.

nodalBodyName string

The name of the new nodal body. If empty, default name will be generated.

importMeshAfterCreate bool

The flag that indicates importing new mesh file into the or not.

addToModel bool

The flag that indicates adding new mesh file to the model.

createGroup bool

The flag that indicates creating new group by using the solid body and the new nodal body.

groupName string

The name of the new group.

facetParameters FacetParameters?

Facet parameters. If it is not given, default values will be used.

Returns

Obj

The new NodalBody entity if importMeshAfterCreate flag is true. Otherwise, empty will be returned.

Exceptions

ArgumentNullException

Will be thrown if body or pathMeshFile arguments are empty.

CreateSolidBlock(SubSystemDocument, Vector, ExpressionValueVariable, ExpressionValueVariable, ExpressionValueVariable, string, BooleanOperationType, Color?, SymmetricType, bool)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "width", "height", "depth" })]
public static Obj CreateSolidBlock(this SubSystemDocument document, Vector position, ExpressionValueVariable width, ExpressionValueVariable height, ExpressionValueVariable depth, string bodyName = "", BooleanOperationType booleanOperationType = BooleanOperationType.None, Color? color = null, SymmetricType symmetricType = SymmetricType.None, bool isInterface = false)

Parameters

document SubSystemDocument

The document to create the block solid body.

position Vector

The position to create the block solid body.

width ExpressionValueVariable

The width of the block.

height ExpressionValueVariable

The height of the block.

depth ExpressionValueVariable

The depth of the blodk.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

booleanOperationType BooleanOperationType

The boolean operation type. If None, new will be created. otherwise, New block geometry will be merged to the existing which has same name with 'name' argument.

color Color?

The color of the new block geometry. The default value is '0xBFAAAA'

symmetricType SymmetricType

The symmetric type of the new .

isInterface bool

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

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document' is null.

ArgumentOutOfRangeException

Will be thrown if 'width', 'height', 'depth' values equal to or less than 0.

CreateSolidBlock(SubSystemDocument, Vector, string)

Create with builder.

public static Obj CreateSolidBlock(this SubSystemDocument document, Vector position, string bodyName)

Parameters

document SubSystemDocument

The document to create the block solid body.

position Vector

The position to create the block solid body.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

Returns

Obj

The new object created by this API.

CreateSolidCylinder(SubSystemDocument, Vector, Vector, ExpressionValueVariable, string, BooleanOperationType, Color?, SymmetricType, bool)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "radius" })]
public static Obj CreateSolidCylinder(this SubSystemDocument document, Vector bottomPosition, Vector topPosition, ExpressionValueVariable radius, string bodyName = "", BooleanOperationType booleanOperationType = BooleanOperationType.None, Color? color = null, SymmetricType symmetricType = SymmetricType.None, bool isInterface = false)

Parameters

document SubSystemDocument

The document to create the cylinder solid body.

bottomPosition Vector

The bottom position to create the cylinder solid body.

topPosition Vector

The top position to create the cylinder solid body.

radius ExpressionValueVariable

The radius of the cylinder.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

booleanOperationType BooleanOperationType

The boolean operation type. If None, new will be created. otherwise, New cylinder geometry will be merged to the existing which has same name with 'name' argument.

color Color?

The color of the new cylinder geometry. The default value is '0xBFAAAA'

symmetricType SymmetricType

The symmetric type of the new .

isInterface bool

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

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document' is null.

ArgumentOutOfRangeException

Will be thrown if 'radius' value equal to or less than 0.

ArgumentException

Will be thrown if 'bottomPosition' equal to 'topPosition'.

CreateSolidCylinder(SubSystemDocument, Vector, Vector, string)

Create with builder.

public static Obj CreateSolidCylinder(this SubSystemDocument document, Vector bottomPosition, Vector topPosition, string bodyName)

Parameters

document SubSystemDocument

The document to create the cylinder solid body.

bottomPosition Vector

The bottom position to create the cylinder solid body.

topPosition Vector

The top position to create the cylinder solid body.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

Returns

Obj

The new object created by this API.

CreateSolidSphere(SubSystemDocument, Vector, ExpressionValueVariable, string, BooleanOperationType, Color?, SymmetricType, bool)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "radius" })]
public static Obj CreateSolidSphere(this SubSystemDocument document, Vector centerPosition, ExpressionValueVariable radius, string bodyName = "", BooleanOperationType booleanOperationType = BooleanOperationType.None, Color? color = null, SymmetricType symmetricType = SymmetricType.None, bool isInterface = false)

Parameters

document SubSystemDocument

The document to create the sphere solid body.

centerPosition Vector

The center position to create the sphere solid body.

radius ExpressionValueVariable

The radius of the sphere.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

booleanOperationType BooleanOperationType

The boolean operation type. If None, new will be created. otherwise, New sphere geometry will be merged to the existing which has same name with 'name' argument.

color Color?

The color of the new sphere geometry. The default value is '0xBFAAAA'

symmetricType SymmetricType

The symmetric type of the new .

isInterface bool

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

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document' is null.

ArgumentOutOfRangeException

Will be thrown if 'radius' value equal to or less than 0.

CreateSolidSphere(SubSystemDocument, Vector, string)

Create with builder.

public static Obj CreateSolidSphere(this SubSystemDocument document, Vector centerPosition, string bodyName)

Parameters

document SubSystemDocument

The document to create the sphere solid body.

centerPosition Vector

The center position to create the sphere solid body.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

Returns

Obj

The new object created by this API.

CreateSolidTriPlate(SubSystemDocument, Vector, Vector, Vector, ExpressionValueVariable, string, BooleanOperationType, Color?, SymmetricType, bool)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "height" })]
public static Obj CreateSolidTriPlate(this SubSystemDocument document, Vector firstPosition, Vector secondPosition, Vector thirdPosition, ExpressionValueVariable height, string bodyName = "", BooleanOperationType booleanOperationType = BooleanOperationType.None, Color? color = null, SymmetricType symmetricType = SymmetricType.None, bool isInterface = false)

Parameters

document SubSystemDocument

The document to create the triplate solid body.

firstPosition Vector

The first position to create the triplate solid body.

secondPosition Vector

The second position to create the triplate solid body.

thirdPosition Vector

The third position to create the triplate solid body.

height ExpressionValueVariable

The height of the triplate.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

booleanOperationType BooleanOperationType

The boolean operation type. If None, new will be created. otherwise, New triplate geometry will be merged to the existing which has same name with 'name' argument.

color Color?

The color of the new triplate geometry. The default value is '0xBFAAAA'

symmetricType SymmetricType

The symmetric type of the new .

isInterface bool

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

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document' is null.

ArgumentOutOfRangeException

Will be thrown if 'height' value equal to or less than 0.

ArgumentException

Will be thrown if the condition of triangle's crossproduct is not met.

CreateSolidTriPlate(SubSystemDocument, Vector, Vector, Vector, string)

Create with builder.

public static Obj CreateSolidTriPlate(this SubSystemDocument document, Vector firstPosition, Vector secondPosition, Vector thirdPosition, string bodyName)

Parameters

document SubSystemDocument

The document to create the triplate solid body.

firstPosition Vector

The first position to create the triplate solid body.

secondPosition Vector

The second position to create the triplate solid body.

thirdPosition Vector

The third position to create the triplate solid body.

bodyName string

The name of the . If empty, default name starts with 'BD_' will be generated and used. If booleanOperationType argument is other than 'None', this argument must be the existing name.

Returns

Obj

The new object created by this API.

UpdateBody(Obj)

Update body.

[NotNullObj(new string[] { "body" })]
public static void UpdateBody(this Obj body)

Parameters

body Obj

The body to be updated.

Exceptions

ArgumentNullException

Will be thrown if 'body' arguments are empty.

ArgumentException

Will be thrown if 'body' argument is not empty and type of 'body' is not or .

Connect with Ansys