Hi!
In nxmc we use Eclipse viewers, so code to got parent/child relations is actually decoupled into separate pieces. Simple code to print object tree, which you can use as an example:
Best regards,
Victor
In nxmc we use Eclipse viewers, so code to got parent/child relations is actually decoupled into separate pieces. Simple code to print object tree, which you can use as an example:
Code Select
private void printObject(GenericObject object, int level)
{
for(int i = 0; i < level; i++)
System.out.print(' ');
System.out.println(object.getObjectName());
for(GenericObject o : object.getChildsAsArray())
printObject(o, level + 2);
}
public void main() throws Exception
{
final NXCSession session = connect(); // obtain session somehow
session.syncObjects();
GenericObject object = session.findObjectById(1, EntireNetwork.class);
printObject(object, 0);
session.disconnect();
}
Best regards,
Victor
