set oRoot = Application.ActiveProject.ActiveScene.Root
set oNull = oRoot.AddPrimitive("Null", "MyNull")
oNull.Kinematics.Global.Parameters("posy").Value = 4.0
oNull.Kinematics.Global.Parameters("posx").Value = 3.0
set oCube = oRoot.AddGeometry("Cube", "MeshSurface")
oCube.Kinematics.Global.Parameters("posz").Value = 2.0
set oEnv = oCube.ApplyEnvelope(oNull)
if oCube.HasStaticKinematicState then
set oStaticKinematicState = oCube.GetStaticKinematicState
set oTrans = oStaticKinematicState.Transform
set oVec3 = XSIMath.CreateVector3
oTrans.GetTranslation oVec3
oVec3.x = oVec3.x * 2.0
oVec3.y = oVec3.y * 2.0
oVec3.Z = oVec3.z * 2.0
oTrans.SetTranslation oVec3
oStaticKinematicState.Transform = oTrans
end if |