#
# This example illustrates how to get the active primitive object from an
# X3DObject object and how to detect if the object supports primitives.
#
from win32com.client import constants
Application.NewScene( None, False )
cube = Application.ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )
twist = Application.ApplyOp("Twist", cube, 3, "siPersistentOperation", None, 0)[ 0 ]
twist.angle.AddFcurve( None, constants.siLinearInterpolation, None, [ 1.0, 0.0, 10.0, 180.0 ] )
Application.LogMessage( cube.ActivePrimitive.Geometry.Points[ 5 ].Position.Y )
Application.LogMessage( cube.GetActivePrimitive2(5).Geometry.Points[ 5 ].Position.Y )
# Expected results:
# INFO : -4.0
# INFO : 3.24463830138 |