#
# This example demonstrates how to get a non-connected Node port value at different time
#
import win32com.client
from win32com.client import constants
xsi = Application
xsi.NewScene("", 0)
xsi.CreatePrim("Grid", "MeshSurface", "", "")
xsi.ApplyOp("ICETree", "grid", "siNode", "siPersistentOperation", "", 0)
xsi.AddICENode("InitializeNode", "grid.polymsh.ICETree")
xsi.SetValue("grid.polymsh.ICETree.InitDataNode.PredefinedAttributeName", "EdgeLength", "")
xsi.AddAttributeToSetDataICENode("grid.polymsh.ICETree.InitDataNode", "EdgeLength", constants.siComponentDataTypeFloat, constants.siComponentDataContextComponent1D, constants.siComponentDataStructureSingle )
xsi.SelectObj("grid.polymsh.ICETree.InitDataNode", "", "")
initDataNode = xsi.Selection(0)
nodeport = initDataNode.InputPorts("EdgeLength")
xsi.SaveKey( "grid.polymsh.ICETree.InitDataNode.EdgeLength", 1.000, 5.000 );
xsi.SaveKey( "grid.polymsh.ICETree.InitDataNode.EdgeLength", 5.000, 25.000 );
xsi.LogMessage( "EdgeLength value at frame 1: " + str(nodeport.GetValueAtFrame(1.0)) )
nodeport.PutValueAtFrame( 5.0, 85.0 )
xsi.LogMessage( "EdgeLength value at frame 5: " + str(nodeport.GetValueAtFrame(5.0)) )
# Expected results:
# INFO : EdgeLength value at frame 1: 5.0
# INFO : EdgeLength value at frame 5: 85.0 |