Nested groups

Nested groups

craig_dickson
Not applicable
19 Views
2 Replies
Message 1 of 3

Nested groups

craig_dickson
Not applicable

[ FlexSim 22.1.1 ]

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!

0 Likes
Accepted solutions (1)
20 Views
2 Replies
Replies (2)
Message 2 of 3

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution


Object oDP=Group("DecisionPointGroups")[iSorter].as(Group)[iDP];
0 Likes
Message 3 of 3

craig_dickson
Not applicable
D'oh. I should have known that! Thank you.
0 Likes