Skip to main content

Motion Standalone Preprocessor C# library 2026 R1

Class ContactAPI

Last update: 09.03.2026

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

This class implements APIs for contact classes.

public static class ContactAPI

Inheritance

object ← ContactAPI

Extension Methods

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

Methods

CreateAutoContact(SubSystemDocument, IEnumerable<Obj>, ExpressionValueVariable?, string)

[NotNull(new string[] { "subSystemDocument", "objectList" })]
public static Obj CreateAutoContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> objectList, ExpressionValueVariable? maximumDistance = null, string name = "")

Parameters

subSystemDocument SubSystemDocument

objectList IEnumerable<Obj>

maximumDistance ExpressionValueVariable?

name string

Returns

Obj

CreateCVCV(SubSystemDocument, Obj, Obj, string, FrictionContact, ExpressionValueVariable?, ExpressionValueVariable?, ExpressionValueVariable?)

[NotNull(new string[] { "subSystemDocument" })]
[NotNullObj(new string[] { "baseCurveset", "actionCurveset" })]
[MatchTypeObj(new object[] { "baseCurveset", typeof(IContactableRigid2D), "actionCurveset", typeof(IContactableRigid2D) })]
public static Obj CreateCVCV(this SubSystemDocument subSystemDocument, Obj baseCurveset, Obj actionCurveset, string name = "", FrictionContact friction = null, ExpressionValueVariable? baseClearance = null, ExpressionValueVariable? actionClearance = null, ExpressionValueVariable? stiffScaleFactor = null)

Parameters

subSystemDocument SubSystemDocument

baseCurveset Obj

actionCurveset Obj

name string

friction FrictionContact

baseClearance ExpressionValueVariable?

actionClearance ExpressionValueVariable?

stiffScaleFactor ExpressionValueVariable?

Returns

Obj

CreateColorCurveSet(SubSystemDocument, Obj, IEnumerable<Color>, string)

[NotNull(new string[] { "subSystemDocument", "colors" })]
[NotNullObj(new string[] { "body" })]
public static Obj CreateColorCurveSet(this SubSystemDocument subSystemDocument, Obj body, IEnumerable<Color> colors, string name = "")

Parameters

subSystemDocument SubSystemDocument

body Obj

colors IEnumerable<Color>

name string

Returns

Obj

CreateColorCurveSet(PartDocument, Obj, IEnumerable<Color>, string)

Create by color.

[NotNull(new string[] { "document", "colors" })]
[NotNullObj(new string[] { "body" })]
public static Obj CreateColorCurveSet(this PartDocument document, Obj body, IEnumerable<Color> colors, string name = "")

Parameters

document PartDocument

The to create a curve set by color.

body Obj

The body of a curve set.

colors IEnumerable<Color>

The colors of edges.

name string

The name of a curve set. If empty, default name starts with 'CURVESET' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'colors', 'body' argument is null.

ArgumentException

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

CreateColorFaceSet(SubSystemDocument, Obj, IEnumerable<Color>, string)

[NotNull(new string[] { "subSystemDocument", "colors" })]
[NotNullObj(new string[] { "body" })]
public static Obj CreateColorFaceSet(this SubSystemDocument subSystemDocument, Obj body, IEnumerable<Color> colors, string name = "")

Parameters

subSystemDocument SubSystemDocument

body Obj

colors IEnumerable<Color>

name string

Returns

Obj

CreateColorFaceSet(PartDocument, Obj, IEnumerable<Color>, string)

Create by color.

[NotNull(new string[] { "document", "colors" })]
[NotNullObj(new string[] { "body" })]
public static Obj CreateColorFaceSet(this PartDocument document, Obj body, IEnumerable<Color> colors, string name = "")

Parameters

document PartDocument

The to create a face set by color.

body Obj

The body of a face set.

colors IEnumerable<Color>

The colors of faces.

name string

The name of a face set. If empty, default name starts with 'FACESET_' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'colors', 'body' argument is null.

ArgumentException

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

CreateContactTolerance(SubSystemDocument, IEnumerable<Obj>)

Create contact tolerance.

[NotNull(new string[] { "subSystemDocument", "objectList" })]
public static void CreateContactTolerance(this SubSystemDocument subSystemDocument, IEnumerable<Obj> objectList)

Parameters

subSystemDocument SubSystemDocument

The to create contact tolerances.

objectList IEnumerable<Obj>

The object list of contacts.

Exceptions

ArgumentNullException

Will be thrown if 'subSystemDocument', 'objectList' argument is null.

ArgumentException

Will be thrown if the type of 'objectList' is not equal to .

CreateCurveSet(SubSystemDocument, IEnumerable<Obj>, string)

[NotNull(new string[] { "subSystemDocument", "edges" })]
public static Obj CreateCurveSet(this SubSystemDocument subSystemDocument, IEnumerable<Obj> edges, string name = "")

Parameters

subSystemDocument SubSystemDocument

edges IEnumerable<Obj>

name string

Returns

Obj

CreateCurveSet(SubSystemDocument, string, Obj, string)

[NotNull(new string[] { "subSystemDocument" })]
[NotNullObj(new string[] { "body" })]
[ExistFile(new string[] { "filePath" })]
public static Obj CreateCurveSet(this SubSystemDocument subSystemDocument, string filePath, Obj body, string name = "")

Parameters

subSystemDocument SubSystemDocument

filePath string

body Obj

name string

Returns

Obj

CreateCurveSet(PartDocument, IEnumerable<Obj>, string)

Create

[NotNull(new string[] { "document", "edges" })]
public static Obj CreateCurveSet(this PartDocument document, IEnumerable<Obj> edges, string name = "")

Parameters

document PartDocument

The to create a curve set by edges.

edges IEnumerable<Obj>

The edges of a curve set.

name string

The name of a curve set. If empty, default name starts with 'CURVESET' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'edges' argument is null.

ArgumentException

Will be thrown if the type of 'edges' is not equal to .

CreateCurveSet(PartDocument, string, Obj, string)

Create

[NotNull(new string[] { "document" })]
[NotNullObj(new string[] { "body" })]
[ExistFile(new string[] { "filePath" })]
public static Obj CreateCurveSet(this PartDocument document, string filePath, Obj body, string name = "")

Parameters

document PartDocument

The to create a curve set by file import.

filePath string

The file path about points of a curve set.

body Obj

The body of a curve set.

name string

The name of a curve set. If empty, default name starts with 'CURVESET' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'body' argument is null.

ArgumentException

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

CreateCylinderToMultiCurveContact(SubSystemDocument, IEnumerable<Obj>, Obj, string)

[NotNull(new string[] { "subSystemDocument", "baseGeomerty" })]
[NotNullObj(new string[] { "actionGeomerty" })]
public static Obj CreateCylinderToMultiCurveContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> baseGeomerty, Obj actionGeomerty, string name = "")

Parameters

subSystemDocument SubSystemDocument

baseGeomerty IEnumerable<Obj>

actionGeomerty Obj

name string

Returns

Obj

CreateCylinderToMultiCurveContact(SubSystemDocument, IEnumerable<Obj>, Obj, Vector, Vector, ExpressionValueVariable?, string)

[NotNull(new string[] { "subSystemDocument", "baseGeomerty" })]
[NotNullObj(new string[] { "actionGeomerty" })]
public static Obj CreateCylinderToMultiCurveContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> baseGeomerty, Obj actionGeomerty, Vector bottomPosition, Vector topPosition, ExpressionValueVariable? radius = null, string name = "")

Parameters

subSystemDocument SubSystemDocument

baseGeomerty IEnumerable<Obj>

actionGeomerty Obj

bottomPosition Vector

topPosition Vector

radius ExpressionValueVariable?

name string

Returns

Obj

CreateExtractFaceSet(SubSystemDocument, Obj, Obj, ExpressionValueVariable?, string, bool, string, bool)

[NotNull(new string[] { "subSystemDocument" })]
[NotNullObj(new string[] { "firstBody", "secondBody" })]
public static void CreateExtractFaceSet(this SubSystemDocument subSystemDocument, Obj firstBody, Obj secondBody, ExpressionValueVariable? unused = null, string firstFacesetName = "", bool splitFirstBody = false, string secondFacesetName = "", bool splitSecondBody = false)

Parameters

subSystemDocument SubSystemDocument

firstBody Obj

secondBody Obj

unused ExpressionValueVariable?

firstFacesetName string

splitFirstBody bool

secondFacesetName string

splitSecondBody bool

CreateExtractFaceSet(SubSystemDocument, IEnumerable<Obj>, Obj, ExpressionValueVariable?, string, bool, string, bool)

[NotNull(new string[] { "subSystemDocument", "faces" })]
[NotNullObj(new string[] { "secondBody" })]
public static void CreateExtractFaceSet(this SubSystemDocument subSystemDocument, IEnumerable<Obj> faces, Obj secondBody, ExpressionValueVariable? tolerance = null, string firstFacesetName = "", bool splitFirstBody = false, string secondFacesetName = "", bool splitSecondBody = false)

Parameters

subSystemDocument SubSystemDocument

faces IEnumerable<Obj>

secondBody Obj

tolerance ExpressionValueVariable?

firstFacesetName string

splitFirstBody bool

secondFacesetName string

splitSecondBody bool

CreateFaceSet(SubSystemDocument, IEnumerable<Obj>, string)

[NotNull(new string[] { "subSystemDocument", "faces" })]
public static Obj CreateFaceSet(this SubSystemDocument subSystemDocument, IEnumerable<Obj> faces, string name = "")

Parameters

subSystemDocument SubSystemDocument

faces IEnumerable<Obj>

name string

Returns

Obj

CreateFaceSet(PartDocument, IEnumerable<Obj>, string)

Create

[NotNull(new string[] { "document", "faces" })]
public static Obj CreateFaceSet(this PartDocument document, IEnumerable<Obj> faces, string name = "")

Parameters

document PartDocument

The to create a face set.

faces IEnumerable<Obj>

The faces of a face set.

name string

The name of a face set. If empty, default name starts with 'FACESET_' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'document', 'faces' argument is null.

ArgumentException

Will be thrown if the type of 'faces' is not equal to .

CreateGeneralContact(IDocument, Obj, Obj, string)

[NotNull(new string[] { "document" })]
[NotNullObj(new string[] { "baseEntity", "actionEntity" })]
public static Obj CreateGeneralContact(this IDocument document, Obj baseEntity, Obj actionEntity, string contactName = "")

Parameters

document IDocument

baseEntity Obj

actionEntity Obj

contactName string

Returns

Obj

CreateGeneralContactWithFaces(IDocument, IEnumerable<Obj>, IEnumerable<Obj>, string)

[NotNull(new string[] { "document", "baseFaces", "actionFaces" })]
public static Obj CreateGeneralContactWithFaces(this IDocument document, IEnumerable<Obj> baseFaces, IEnumerable<Obj> actionFaces, string contactName = "")

Parameters

document IDocument

baseFaces IEnumerable<Obj>

actionFaces IEnumerable<Obj>

contactName string

Returns

Obj

CreateMbyNContact(SubSystemDocument, IEnumerable<Obj>, IEnumerable<Obj>, string)

Create

[NotNull(new string[] { "subSystemDocument", "baseGeomerty", "actionGeomerty" })]
public static Obj CreateMbyNContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> baseGeomerty, IEnumerable<Obj> actionGeomerty, string name = "")

Parameters

subSystemDocument SubSystemDocument

The to create M by N contacts.

baseGeomerty IEnumerable<Obj>

The base geomerty of M by N contacts.

actionGeomerty IEnumerable<Obj>

The action geomerty of M by N contacts.

name string

The name of M by N contacts. If empty, default name starts with 'MbyN' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'subSystemDocument', 'baseGeomerty', 'actionGeomerty' argument is null.

ArgumentException

Will be thrown if the type of 'baseGeomerty', 'actionGeomerty' is not equal to and .

CreateMultiCurveToMultiCurveContact(SubSystemDocument, IEnumerable<Obj>, IEnumerable<Obj>, string)

[NotNull(new string[] { "subSystemDocument", "baseGeomerty", "actionGeomerty" })]
public static Obj CreateMultiCurveToMultiCurveContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> baseGeomerty, IEnumerable<Obj> actionGeomerty, string name = "")

Parameters

subSystemDocument SubSystemDocument

baseGeomerty IEnumerable<Obj>

actionGeomerty IEnumerable<Obj>

name string

Returns

Obj

CreateNCombinationContact(SubSystemDocument, IEnumerable<Obj>, string)

Create

[NotNull(new string[] { "subSystemDocument", "geomerty" })]
public static Obj CreateNCombinationContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> geomerty, string name = "")

Parameters

subSystemDocument SubSystemDocument

The to create N combination contacts.

geomerty IEnumerable<Obj>

The geomerty of N combination contacts.

name string

The name of N combination contacts. If empty, default name starts with 'NCombi' will be generated and used.

Returns

Obj

The new object created by this API.

Exceptions

ArgumentNullException

Will be thrown if 'subSystemDocument', 'geomerty' argument is null.

ArgumentException

Will be thrown if the type of 'geomerty' is not equal to and .

CreatePTCV(SubSystemDocument, Obj, Obj, Vector, string, Relative, FrictionContact, ExpressionValueVariable?, ExpressionValueVariable?)

[NotNull(new string[] { "subSystemDocument" })]
[NotNullObj(new string[] { "baseCurveset", "actionBody" })]
[MatchTypeObj(new object[] { "baseCurveset", typeof(IContactableRigid2D), "actionBody", typeof(IConnectable) })]
public static Obj CreatePTCV(this SubSystemDocument subSystemDocument, Obj baseCurveset, Obj actionBody, Vector actionPosition, string name = "", Relative relative = null, FrictionContact friction = null, ExpressionValueVariable? baseClearance = null, ExpressionValueVariable? stiffScaleFactor = null)

Parameters

subSystemDocument SubSystemDocument

baseCurveset Obj

actionBody Obj

actionPosition Vector

name string

relative Relative

friction FrictionContact

baseClearance ExpressionValueVariable?

stiffScaleFactor ExpressionValueVariable?

Returns

Obj

CreateSphereToMultiCurveContact(SubSystemDocument, IEnumerable<Obj>, Obj, string)

[NotNull(new string[] { "subSystemDocument", "baseGeomerty" })]
[NotNullObj(new string[] { "actionGeomerty" })]
public static Obj CreateSphereToMultiCurveContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> baseGeomerty, Obj actionGeomerty, string name = "")

Parameters

subSystemDocument SubSystemDocument

baseGeomerty IEnumerable<Obj>

actionGeomerty Obj

name string

Returns

Obj

CreateSphereToMultiCurveContact(SubSystemDocument, IEnumerable<Obj>, Obj, Vector, ExpressionValueVariable?, string)

[NotNull(new string[] { "subSystemDocument", "baseGeomerty" })]
[NotNullObj(new string[] { "actionGeomerty" })]
public static Obj CreateSphereToMultiCurveContact(this SubSystemDocument subSystemDocument, IEnumerable<Obj> baseGeomerty, Obj actionGeomerty, Vector centerPosition, ExpressionValueVariable? radius = null, string name = "")

Parameters

subSystemDocument SubSystemDocument

baseGeomerty IEnumerable<Obj>

actionGeomerty Obj

centerPosition Vector

radius ExpressionValueVariable?

name string

Returns

Obj

Connect with Ansys