hello
i looked up the SDK and found "GetOutputTarget"
i would like to get all the ports logged that a particular node is connected to.
but i have some troubles to use this successfully...
GetOutputTarget
-
caledonian_tartan
- Posts: 253
- Joined: 17 Feb 2010, 14:13
Re: GetOutputTarget
now i use this to get the connections of a particular node of the selected ice tree
how can i get the input value (string/reference) of a "get data" node of the SELECTED pointcloud??
Code: Select all
from siutils import log # LogMessage
for op in Application.Selection(0).ActivePrimitive.ConstructionHistory:
if op.Type == "ICETree":
ICETree = op
# output port direction
log("output ports")
for node in op.Nodes:
for port in node.OutputPorts:
for connectedPort,connectedNode in zip(port.ConnectedPorts, port.ConnectedNodes):
if node.Name == "PPG_Connector":
log("%s.%s -> %s.%s" % (node.Name, port.Name, connectedNode.Name, connectedPort.Name))
# input port direction
log("input ports")
for node in op.Nodes:
for port in node.InputPorts:
for connectedPort,connectedNode in zip(port.ConnectedPorts, port.ConnectedNodes):
if connectedNode.Name == "PPG_Connector":
log("%s.%s -> %s.%s" % (node.Name, port.Name, connectedNode.Name, connectedPort.Name))
Code: Select all
here's a working example using the pointcloud name:
oTest = Application.GetValue("pointcloud.pointcloud.ICETree.PPG_Connector.PPG_Name_string")
print oTest
SI 2015 @ WIN7-64
-
csaez
- Posts: 253
- Joined: 09 Jul 2012, 13:31
- Skype: csaezmargotta
- Location: Sydney, Australia
Re: GetOutputTarget
Hi,
You can get it from the parameters of the node
You can get it from the parameters of the node
Code: Select all
from siutils import si, log
for ICETree in si.Selection(0).ActivePrimitive.ICETrees:
for node in ICETree.Nodes:
for port in node.InputPorts:
for connectedNode in port.ConnectedNodes:
for param in connectedNode.Parameters:
log("{0}: {1}".format(param.FullName, param.Value))-
caledonian_tartan
- Posts: 253
- Joined: 17 Feb 2010, 14:13
Re: GetOutputTarget
cool! this works, thanks!
thing is that it returns the value 4 times although it only has one input...
thing is that it returns the value 4 times although it only has one input...
SI 2015 @ WIN7-64
