How can I determine the number of subnodes on a processor that have a specific label? For instance, assume some subnodes are labeled "A" while others are labeled "B". How I can refer to the quantity of each in the pull from list?
How can I determine the number of subnodes on a processor that have a specific label? For instance, assume some subnodes are labeled "A" while others are labeled "B". How I can refer to the quantity of each in the pull from list?
You'd usually test the value of the label not that it exists:
Table.query("SELECT count($2) FROM $1 WHERE $2.Type='A'",token.csb,$iter(1))[1][1]
Label names should reflect the name of a category not the value that needs to be written on it.
@Jason Lightfoot that code does not work in the "Request/Require Number" section of a Pull from List activity (please see the picture above in previous post).
I know this one works: token.csb.subnodes.length (token.csb is the processor object) but I want to refer to specific item on the processor and the length of that item so referring to length of subnodes with specific label such color or name on them. How I can do that?
Jason's expression directly returns the number of subnodes whose "Type" label has a value of "A" without the need for a list. So you could put it into the Value field of an "Assign Labels" activity for example.
And just so there is no misunderstanding: "length" is the number of entries in an array. If you want to query the size of objects you'd use "object.size.x/y/z".
- Table.query("SELECT SUM($2.size.x) FROM $1 WHERE $2.Type='A'",token.csb,$iter(1))[1][1]
This would return the total size along the x-axis of all items with type A on the processor.
What makes you think it doesn't work? Here's a working example.
@Jason Lightfoot @Felix Möhlmann you're correct, I made a mistake in writing the query. Thanks!
15 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