Kim Jh,
The following code will print the names of the objects connected to a network node designated as the so() object. You can replace the so() reference with any method that you find easier to use.
treenode networknode = so(); treenode stations = getvarnode(networknode, "stations"); for(int i1 = 2; i1 <= content(stations); i1++){ treenode tempobj = ownerobject(tonode(getnodenum(rank(stations, i1)))); pr(); pt(getname(tempobj)); }
Basically, the references to the objects connected to the network nodes are stored as couplings in the stations variable on the network node. The first node is a coupling to itself and the remaining are to any objects that are connected to the network node (That is why the for loop starts at 2). The code that sets the tempobj variable is the method that I use for getting the object that owns the other side of the coupling reference.
Good Luck,
Brandon
4 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved