NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
Call StaticKinematicStateBasePosition(oRoot)
set oNull = oRoot.AddPrimitive( "Null","MyNull")
oNull.Kinematics.Global.Parameters("posy").Value = 6.0
set oCube = oRoot.AddGeometry("Cube","MeshSurface")
set oEnv = oCube.ApplyEnvelope(oNull)
Call StaticKinematicStateBasePosition(oCube)
Sub StaticKinematicStateBasePosition(in_Obj)
Dim l_vec3
if in_Obj.HasStaticKinematicState then
set l_vec3 = XSIMath.CreateVector3
in_Obj.GetStaticKinematicState.Transform.GetTranslation l_vec3
Application.LogMessage "The StaticKinematicState property position is X " & l_vec3.X & " Y " & l_vec3.Y & " Z " & l_vec3.Z
else
Application.LogMessage "There's no StaticKinematicState property on this object."
end if
end sub
' Expected results:
'INFO : There's no StaticKinematicState property on this object.
'INFO : The StaticKinematicState property position is X 0 Y 0 Z 0 |