question

Craig DIckson avatar image
0 Likes"
Craig DIckson asked Craig DIckson commented

Nested groups

Is there a way to refer to an object in a nested group in a single statement?

I have four groups; each group contains the DPs on a different conveyor sorter (all identical), each with ten DPs. I tried to simplify the code (and make it easier to read) by nesting the four groups into a single group, and then referring to the DP using the sorter index (1-4) and DP index (1-10)(rather than calculating an overall index of 1-40 for each one).

I was hoping to be able to write something like:

Object oDP = Group("DecisionPointGroups")[iSorter][iDP];

Instead it looks like I have to write it as two statements:

Group gSorter =  Group("DecisionPointGroups")[iSorter] ;
Object oDP = gSorter[iDP];

Not a huge deal, but if there is a way to have it on a single line I'd be very interested.

Thanks!

FlexSim 22.1.1
groupsnesting
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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Craig DIckson commented


Object oDP=Group("DecisionPointGroups")[iSorter].as(Group)[iDP];
· 1
5 |100000

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

Craig DIckson avatar image Craig DIckson commented ·
D'oh. I should have known that! Thank you.
0 Likes 0 ·