SchematicNode.Nodes

導入

v10.0 (2012)

詳細

この Schematic ノードの直接の子ノードを SchematicNodeCollection オブジェクトとして戻します。スケマティック ビューに表示されたノードだけが戻されます。ノード ブランチですべての子にアクセスするには、このメソッドを再帰的に使用する必要があります。

C#構文

// get accessor

SchematicNodeCollection rtn = SchematicNode.Nodes;

Python の例

#

# Script to demonstrate how to access a SchematicNode object and reads its UI position.

#

# import some Softimage python shortcuts

from sipyutils import *

def log_node_info( node, spc='' ):

	(x,y,w,h) = node.UIInfo

	log( '%sname=%s x=%d y=%d w=%d h=%d parent=%s object=%s selected=%d expanded=%d' % (spc,node.Name,x,y,w,h,node.Parent,node.Object,node.Selected,node.Expanded) )

def log_node( i, node ):

	spc = i*'..'

	(x,y,w,h) = node.UIInfo	

	log_node_info( node, spc=spc )

	for n in node.Nodes:

		log_node(i+1, n )

# Get the 'MySchematic' schematic view object in the current layout

viewname = 'MySchematic'

activelayout = si().Desktop.ActiveLayout

v = activelayout.Views( viewname )

# 'MySchematic' view is not created yet

if v == None:

	log('Creating new schematic...: %s' % (viewname))

	v = activelayout.CreateView2( "Schematic", viewname )

# Python needs to convert from View to Schematic object

sv = disp(v)

# Log all nodes in the view

indent = 0

for node in sv.Nodes:

	log_node( indent, node )