I'd like to count the number of objects and activities which are used in a simulation model.
I'd like to count the number of objects and activities which are used in a simulation model.
All the objects in the simulation model will be under the model tree.
To count the number of objects in a simulation model, You can simply use
int numObjs = model().subnodes.length;
you will get the total number of objects in the model in numObjs variable which includes 1 node for model floor and 1 node for Tools
If you also want to know the total number of global tables, user commands etc then you need to go in to tools node to count.
int totalTables=model().find("Tools/GlobalTables").subnodes.length
you can similarly reference the other tools and count respective totals
Thank you asb.
I tried to use this script like the image, but it did't return the correct value.
Could you please check if it's correct.
Either put just
model().subnodes.length
or return numObjs
int numObjs = model().subnodes.length; return numObjs;
11 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