question

Lucas Klein avatar image
0 Likes"
Lucas Klein asked Matthew Gillespie answered

Select all subnodes once

Dear all,

Is there any way to reference all subnodes from an object at once without using a "for"?

For example, after combining a few itens, at the end of process, paint all the boxes inside a pallet.

Thanks in advance.

FlexSim 17.1.2
itemsubnodesrankfor
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

That's exactly the point of a for loop.

for(int i = 1; i <= pallet.subnodes.length; i++)
	pallet.subnodes[i].as(Object).color = Color.byNumber(i);

We have plans to add a foreach loop in the future that will make the for loop syntax easier for this sort of thing.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.