X3DObject.Add2DChain

Description

Adds a 2D chain and parents the new chain under this object. A 2D chain has joint properties that can only rotate on their local Z axes.

Note: This method uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference. Normally for scripting you can get the output arguments via the ISIVTCollection, but this method already returns a value (C# cannot use this workaround because it does not have access to the ISIVTCollection).

The only available workaround in this case is to create a VBScript custom command which returns both the output arguments and the return value in one array. For details, see What Happens when the Function Already Returns a Value?.

C# Syntax

ChainRoot X3DObject.Add2DChain( Object in_rootPos, Object in_effPos, Object in_normalPlane, si2DChainAlignType in_alignType, String in_bstrName );

Scripting Syntax

oReturn = X3DObject.Add2DChain( [RootPos], [EffectorPos], [ChainNormalPlane], [AlignType], [Name] );

Return Value

ChainRoot

Parameters

Parameter Type Description
RootPos Either an SIVector3 or an Array The root position of the new chain.

Default Value: (0,0,0)

EffectorPos Either an SIVector3 or an Array The effector position of the new chain.

Default Value: (1,0,0)

ChainNormalPlane Either an SIVector3 or an Array The chain's normal to the plane.

Default Value: (0,0,1)

AlignType si2DChainAlignType The view reference used for computing the root orientation.

Default Value: si2DChainTop

Name String name of new chain

Examples

VBScript Example

set oRoot = Application.ActiveProject.ActiveScene.Root
set oChain = oRoot.Add2DChain
oRootPos = Array(0,10,0)
oEffPos = Array(10,10,0)
set oChain = oRoot.Add2DChain( oRootPos, oEffPos, , si2DChainTop )

See Also

ChainRoot