#
# This example demonstrates how to get and set a port value on an InitData node
#
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")
nodeport.Value = 5.0
xsi.LogMessage( "EdgeLength value: " + str(nodeport.Value) )
# Expected results:
# INFO : EdgeLength value: 5.0 |