Skip to main content

Motion Standalone Preprocessor C# library 2026 R1

Class BodyAPI

Last update: 09.03.2026

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

This class implements APIs for class.

public static class BodyAPI

Inheritance

object ← BodyAPI

Extension Methods

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

Methods

CreateMeshFileInPart(Obj, string, bool, FacetParameters?)

Generate mesh file with given entity.

[NotNullObj(new string[] { "body" })]
[NotNullOrEmpty(new string[] { "pathMeshFile" })]
[MatchTypeObj(new object[] { "body", typeof(Body) })]
public static void CreateMeshFileInPart(this Obj body, string pathMeshFile, bool addToModel = true, FacetParameters? facetParameters = null)

Parameters

body Obj

The to generate mesh file.

pathMeshFile string

Generated mesh file path.

addToModel bool

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

facetParameters FacetParameters?

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

Exceptions

ArgumentNullException

Will be thrown if body or pathMeshFile arguments are empty.

ArgumentException

Will be thrown if the type of 'body' is not .

CreatePartMarker(PartDocument, Obj, TMatrix, string)

Create

[NotNullObj(new string[] { "body" })]
public static Obj CreatePartMarker(this PartDocument document, Obj body, TMatrix transform, string markerName = "")

Parameters

document PartDocument

The document to create a marker.

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.

Returns

Obj

the new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'body' is null.

ArgumentException

Will be thrown if the type of 'body' is not .

CreateSolidBlock(PartDocument, Vector, ExpressionValueVariable, ExpressionValueVariable, ExpressionValueVariable, Color?)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "width", "height", "depth" })]
public static Obj CreateSolidBlock(this PartDocument document, Vector position, ExpressionValueVariable width, ExpressionValueVariable height, ExpressionValueVariable depth, Color? color = null)

Parameters

document PartDocument

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.

color Color?

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

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 are equal to or less than 0.

CreateSolidBlock(PartDocument, Vector)

Create with builder.

public static Obj CreateSolidBlock(this PartDocument document, Vector position)

Parameters

document PartDocument

The document to create the block solid body.

position Vector

The position to create the block solid body.

Returns

Obj

The new object created by this API.

CreateSolidCylinder(PartDocument, Vector, Vector, ExpressionValueVariable, Color?)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "radius" })]
public static Obj CreateSolidCylinder(this PartDocument document, Vector bottomPosition, Vector topPosition, ExpressionValueVariable radius, Color? color = null)

Parameters

document PartDocument

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.

color Color?

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

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 is equal to or less than 0.

ArgumentException

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

CreateSolidCylinder(PartDocument, Vector, Vector)

Create with builder.

public static Obj CreateSolidCylinder(this PartDocument document, Vector bottomPosition, Vector topPosition)

Parameters

document PartDocument

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.

Returns

Obj

The new object created by this API.

CreateSolidSphere(PartDocument, Vector, ExpressionValueVariable, Color?)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "radius" })]
public static Obj CreateSolidSphere(this PartDocument document, Vector centerPosition, ExpressionValueVariable radius, Color? color = null)

Parameters

document PartDocument

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.

color Color?

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

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 is equal to or less than 0.

CreateSolidSphere(PartDocument, Vector)

Create with builder.

public static Obj CreateSolidSphere(this PartDocument document, Vector centerPosition)

Parameters

document PartDocument

The document to create the sphere solid body.

centerPosition Vector

The center position to create the sphere solid body.

Returns

Obj

The new object created by this API.

CreateSolidTriPlate(PartDocument, Vector, Vector, Vector, ExpressionValueVariable, Color?)

Create with builder.

[NotNull(new string[] { "document" })]
[GreaterThanZero(new string[] { "height" })]
public static Obj CreateSolidTriPlate(this PartDocument document, Vector firstPosition, Vector secondPosition, Vector thirdPosition, ExpressionValueVariable height, Color? color = null)

Parameters

document PartDocument

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.

color Color?

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

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 is equal to or less than 0.

ArgumentException

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

CreateSolidTriPlate(PartDocument, Vector, Vector, Vector)

Create with builder.

public static Obj CreateSolidTriPlate(this PartDocument document, Vector firstPosition, Vector secondPosition, Vector thirdPosition)

Parameters

document PartDocument

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.

Returns

Obj

The new object created by this API.

Connect with Ansys