question

Purushothama Tr avatar image
0 Likes"
Purushothama Tr asked Andrew O commented

Issue in creating Bundles

BFSimulation25Percentage - Copy_2_3_kinematics_cradle_3_autosave_2 - Copy_autosave_1_autosave.fsm

In This model Process flow Container name Log Stack Building in side this Find Gap Required Between Logs Custom code Name

There are Two items Log and Plane it need all Log on the Top of the plane after 1 st plane 2nd plane should place above the 1 st plane but at height of (LogDia+Spacer Z axis Length

For one bundle i am using 8 planes at planes are created at time model time 360 minutes

FlexSim 22.2.2
proces flow
· 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.

Andrew O avatar image Andrew O commented ·

Hi @Purushothama Tr, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

In your code you refer to the spacer item through "token.item[token.Rank]". But since the item is created by the "Sub Flow Token" and only ever a single one, the "item" label only has one entry. Thus you get an error for the second run through the sub flow, since "token.item[2]" does not exist. ("Array index out of bounds" error.)

All other errors are then caused by the code terminating early due to that initial error.

1669631811438.png


1669631811438.png (48.7 KiB)
· 2
5 |100000

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

Purushothama Tr avatar image Purushothama Tr commented ·
Please Help me How can get reference of second spacer in custom code
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Purushothama Tr commented ·
I'm not sure what you mean by "second spacer" here. As I see it, you run the sub flow once for each layer. Each time a new spacer item is created and assigned to "token.item".
0 Likes 0 ·

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.