Count Subtreenodes by Code

Count Subtreenodes by Code

robin_brunner
Not applicable
150 Views
2 Replies
Message 1 of 3

Count Subtreenodes by Code

robin_brunner
Not applicable

Hello Community,

my question is: How can I count treenodes by code? I want to count the connections in, out and center by code and save them into an integer.

int conin;
int conout;
int concenter;
conin = ??; //Number of Connections in.
conout = ??; //Number of Connections out.
concenter = ??; //Number of Connections center.

Does anyone know how to do this?

Regards, Robin

0 Likes
Accepted solutions (1)
151 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

The Object class has inObjects, outObjects, and centerObjects properties for accessing objects connected to the object with port connections. These properties also have a length property so you can look up how many objects are connected with each type of port connection.

Object obj = model().find("Queue1");
int conIn = obj.inObjects.length;
int conOut = obj.outObjects.length;
int conCenter = obj.centerObjects.length;


Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

robin_brunner
Not applicable

Thank you very much 🙂

0 Likes