Click or drag to resize
SoInteractionKitSetPartAsPath Method

Sets any public part in the interaction kit as a "surrogate" path instead.

Namespace: OIV.Inventor.Nodekits
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public bool SetPartAsPath(
	string partName,
	SoPath surrogatePath
)

Parameters

partName
Type: SystemString
surrogatePath
Type: OIV.InventorSoPath

Return Value

Type: Boolean
Remarks

The object at the end of the path serves as a stand-in when a pick occurs, and can thus initiate interaction.

Instead of the usual OIV.Inventor.Nodekits.SoBaseKit.SetPart(System.String, OIV.Inventor.Nodes.SoNode), which replaces partName with a new node, this will remove the node being used for partName from the scene and remember the surrogatePath you give it. Later, any pick on surrogatePath will be regarded as a pick on partName.

For example, set the XRotator part of an OIV.Inventor.Draggers.SoTrackballDragger to be the path to an object in the scene. The rest of the trackball will look the same, but the XRotator stripe will disappear. However, click the mouse on the object at the end of surrogatePath and the ball will start to drag in rotation around its X axis.

Note that this is different from setting the part to be the node at the end of the path. When you set the part as a node, a second instance will be drawn in the local space of the interaction kit. When you set it as a path, the object itself is used, not a copy.

The partName may be any part name that follows the nodekit syntax for parts, such as childList[0].shape or rotator.rotatorActive. (See the OIV.Inventor.Nodekits.SoBaseKit.GetPart(System.String, System.Boolean) method in the OIV.Inventor.Nodekits.SoBaseKit reference page for a complete description.)

NOTE: No information about the surrogatePath is written to a file.

See Also