How can I get the index number in an array based on the array value?
For example the array label showing below. Is there a function can search token id: 1050 inside a array and return the index value 2?
How can I get the index number in an array based on the array value?
For example the array label showing below. Is there a function can search token id: 1050 inside a array and return the index value 2?
Put the following in the Value field of an Assign Labels activity:
treenodearray pallets = getlabel(token, "pallet"); return findmatch(arraysize(pallets), gettokenid(pallets[count]) == 1050);
You can read more about findmatch in the user manual. Basically, it is a for loop that returns the count where the second parameter was true. In this case, it returns the count where it found token ID 1050.
3 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