Object Hierarchy | Related C++ Class: Constraint
Constraint
v1.0
The Constraint object represents a constraint in the scene graph. Constraints allow you to constrain objects to other object's animation. For example, you can constrain an object to always point in the direction of another object using the direction constraint. You apply constraints on objects using the Kinematics.AddConstraint method. You can find the constraints that are being applied to an object using the Kinematics.Constraints property or find which constraint is driving a particular parameter using the Parameter.Source property. You can get the Constraint's type with SIObject.Type property.
' ' This example illustrates how to apply a direction constraint to a sphere so that it always ' points in the direction of the null. We then enumerate all the constraints on the sphere ' using the kinematics.contraints property. ' Dim oRoot, oNull, oSphere set oRoot = Application.ActiveProject.ActiveScene.Root set oNull = oRoot.AddNull set oSphere = oRoot.AddGeometry("Sphere","MeshSurface") oSphere.Kinematics.AddConstraint "Direction", oNull set oConstraints = oSphere.Kinematics.Constraints for each oCns in oConstraints LogMessage oCns.FullName next |