Skip to main content

Motion Standalone Preprocessor C# library 2025 R2

Class BallPlacingAPI

Last update: 16.07.2025

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

This class implements APIs for ball placing.

public static class BallPlacingAPI

Inheritance

objectBallPlacingAPI

Extension Methods

LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType), LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType), LinkPropertyItemCache.GetLinkedObjects(object, LinkPropertyType)

Methods

CreateBall(BallInfo)

Create ball.

public static Obj CreateBall(BallInfo ballInfo)

Parameters

ballInfo BallInfo

The ball information to create ball.

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentException

Will be thrown if the Name of 'ballInfo' is null.

ArgumentException

Will be thrown if the Radius of 'ballInfo' is equal to or less than 0.

CreateBallPlacing(SubSystemDocument, string, PathType, string, ExpressionValueVariable?, ExpressionValueVariable?, Color?)

Create ball placing .

[NotNull(new string[] { "document" })]
[ExistFile(new string[] { "path" })]
public static Obj CreateBallPlacing(this SubSystemDocument document, string path, PathType pathType = PathType.Closed, string name = "", ExpressionValueVariable? ballRadius = null, ExpressionValueVariable? numberOfBall = null, Color? color = null)

Parameters

document SubSystemDocument

The document to create the ball placing.

path string

The path to create the ball placing.

pathType PathType

The path type. The default value is Closed.

name string

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

ballRadius ExpressionValueVariable?

The ball radius. The default value is 2.

numberOfBall ExpressionValueVariable?

The number of ball. The default value is 25.

color Color?

The color. The default value is '0xAAAABF'

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'body' are null.

FileNotFoundException

Will be thrown if 'path' file path does not exist.

ArgumentException

Will be thrown if the extension of 'path' is not 'csv'.

ArgumentOutOfRangeException

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

ArgumentOutOfRangeException

Will be thrown if 'numberOfBall' is less than 2 or greater than 999.

CreateBallPlacingContact(SubSystemDocument, IEnumerable, Obj, string)

Create ball placing contact .

[NotNull(new string[] { "document", "baseGeometries" })]
[NotNullObj(new string[] { "ballPlacing" })]
[MatchTypeObj(new object[] { "ballPlacing", typeof(BallPlacing) })]
public static Obj CreateBallPlacingContact(this SubSystemDocument document, IEnumerable<obj> baseGeometries, Obj ballPlacing, string name = "")

Parameters

document SubSystemDocument

The document to create the ball placing contact.

baseGeometries IEnumerable

The base geometries.

ballPlacing Obj

The ball placing.

name string

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

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'baseGeometries', 'ballPlacing', 'ballPlacing' are null.

ArgumentException

Will be thrown if item type of 'baseGeometries' is not .

CreateBallScrew(SubSystemDocument, Vector, Vector, Vector, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ScrewHandType, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?, string)

[NotNull(new string[] { "document" })]
[NotZeroMagnitude(new string[] { "axisZ", "axisX" })]
public static Obj CreateBallScrew(this SubSystemDocument document, Vector shaftReferencePosition, Vector axisZ, Vector axisX, ExpressionValueVariable? shaftLength = null, ExpressionValueVariable? shaftScrewStartAngle = null, ExpressionValueVariable? shaftScrewStartPosition = null, ExpressionValueVariable? shaftScrewEndPosition = null, ExpressionValueVariable? nutLength = null, ExpressionValueVariable? nutOD = null, ExpressionValueVariable? nutStartPosition = null, ExpressionValueVariable? nutScrewStartPosition = null, ExpressionValueVariable? nutScrewEndPosition = null, ScrewHandType handOfScrew = ScrewHandType.Right, ExpressionValueVariable? lead = null, ExpressionValueVariable? shaftPCD = null, ExpressionValueVariable? nutPCD = null, ExpressionValueVariable? ballDiameter = null, string name = "")

Parameters

document SubSystemDocument

shaftReferencePosition Vector

axisZ Vector

axisX Vector

shaftLength ExpressionValueVariable?

shaftScrewStartAngle ExpressionValueVariable?

shaftScrewStartPosition ExpressionValueVariable?

shaftScrewEndPosition ExpressionValueVariable?

nutLength ExpressionValueVariable?

nutOD ExpressionValueVariable?

nutStartPosition ExpressionValueVariable?

nutScrewStartPosition ExpressionValueVariable?

nutScrewEndPosition ExpressionValueVariable?

handOfScrew ScrewHandType

lead ExpressionValueVariable?

shaftPCD ExpressionValueVariable?

nutPCD ExpressionValueVariable?

ballDiameter ExpressionValueVariable?

name string

Returns

Obj

CreateSurfaceWithCurvesets(SubSystemDocument, string, Obj, Obj, Obj, ExpressionValueVariable?, ExpressionValueVariable?, string)

Create surface with curvesets .

[NotNull(new string[] { "document" })]
[ExistFile(new string[] { "path" })]
[NotNullObj(new string[] { "faceSet", "startCurveSet", "endCurveSet" })]
[MatchTypeObj(new object[] { "faceSet", typeof(SetFace), "startCurveSet", typeof(SetCurveForEdges), "endCurveSet", typeof(SetCurveForEdges) })]
public static Obj CreateSurfaceWithCurvesets(this SubSystemDocument document, string path, Obj faceSet, Obj startCurveSet, Obj endCurveSet, ExpressionValueVariable? numberOfSlice = null, ExpressionValueVariable? cuttingPlaneRadius = null, string name = "")

Parameters

document SubSystemDocument

The document to create the surface with curvesets.

path string

The path to create the surface with curvesets.

faceSet Obj

The face set.

startCurveSet Obj

The start curveset.

endCurveSet Obj

The end curveset.

numberOfSlice ExpressionValueVariable?

The number of slice. The default value is 19.

cuttingPlaneRadius ExpressionValueVariable?

The radius of cutting plane. The default value is 10.

name string

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

Returns

Obj

The new object that is created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'faceSet', 'startCurveSet', 'endCurveSet' are null.

FileNotFoundException

Will be thrown if 'path' file path does not exist.

ArgumentException

Will be thrown if the extension of 'path' is not 'csv'.

ArgumentException

Will be thrown if Object of 'startCurveSet' and Object of 'endCurveSet' are the same.

ArgumentException

Will be thrown if item type of 'faceSet' is not .

ArgumentException

Will be thrown if item type of 'startCurveSet' is not .

ArgumentException

Will be thrown if item type of 'endCurveSet' is not .

ArgumentOutOfRangeException

Will be thrown if 'numberOfSlice', 'cuttingPlaneRadius' values equal to or less than 0.

DeleteBall(Obj)

Delete ball.

[NotNullObj(new string[] { "ball" })]
[MatchTypeObj(new object[] { "ball", typeof(SolidBody) })]
public static void DeleteBall(Obj ball)

Parameters

ball Obj

The ball to delete ball.

Exceptions

ArgumentNullException

Will be thrown if 'ball' is null.

ArgumentException

Will be thrown if item type of 'ball' is not .

UpdateBall(Obj, BallInfo)

Update ball.

[NotNullObj(new string[] { "ball" })]
[MatchTypeObj(new object[] { "ball", typeof(SolidBody) })]
public static void UpdateBall(Obj ball, BallInfo ballInfo)

Parameters

ball Obj

The ball to update ball.

ballInfo BallInfo

The ball information to update ball.

Exceptions

ArgumentNullException

Will be thrown if 'ball' is null.

ArgumentException

Will be thrown if item type of 'ball' is not .

ArgumentException

Will be thrown if the Name of 'ballInfo' is null.

ArgumentException

Will be thrown if the Radius of 'ballInfo' is equal to or less than 0.

UpdateFaceSet(Obj, ExpressionValueVariable, ExpressionValueVariable)

Update faceset.

[NotNullObj(new string[] { "faceset" })]
[MatchTypeObj(new object[] { "faceset", typeof(SetFace) })]
public static void UpdateFaceSet(Obj faceset, ExpressionValueVariable maximumPenetration, ExpressionValueVariable offset)

Parameters

faceset Obj

The faceset to update ball.

maximumPenetration ExpressionValueVariable

The maximum penetration.

offset ExpressionValueVariable

The offset.

Exceptions

ArgumentNullException

Will be thrown if 'faceset' is null.

ArgumentException

Will be thrown if item type of 'faceset' is not .

UpdateSurfaceWithCurvesets(Obj, ExpressionValueVariable, ExpressionValueVariable, bool, ExpressionValueVariable)

Update surface with curvesets.

[NotNullObj(new string[] { "surfaceWithCurvesets" })]
[MatchTypeObj(new object[] { "surfaceWithCurvesets", typeof(SurfaceWithCurvesets) })]
public static void UpdateSurfaceWithCurvesets(this Obj surfaceWithCurvesets, ExpressionValueVariable maximumPenetration, ExpressionValueVariable offset, bool isUp, ExpressionValueVariable slice)

Parameters

surfaceWithCurvesets Obj

The surface with curvesets to update ball.

maximumPenetration ExpressionValueVariable

The maximum penetration.

offset ExpressionValueVariable

The offset.

isUp bool

The flag for up or down.

slice ExpressionValueVariable

The slice.

Exceptions

ArgumentNullException

Will be thrown if 'surfaceWithCurvesets' is null.

ArgumentException

Will be thrown if item type of 'surfaceWithCurvesets' is not .

Connect with Ansys