How to Construct Assembly Steps in a loop

Hi experts,

I need some help :slightly_smiling_face:

It is easy to remove assembly steps in a loop using Remove Statement.

image

However, is there any way to construct assembly steps in a loop?
image

When I try to build the assembly inside a loop, it raises the following error:

Output #1::ProcessExecutor::Output #1::Construct error:
Expected process variable "__visual_Tray_CAPs__" to have value type "Ref<Product>"
but the type is "List<Ref<Product>>".

Has anyone encountered this issue before, or knows how to correctly construct assembly steps in a loop?

Thank you in advance.

Sounds like this same issue, the CAP variable becomes a list automatically.

Thank you, Tsy. It works when I add an Assign statement after the Construct statement without checking RemoveAccepted!

Do you know what RemoveAccepted does?
When I check it, the CAP is always assembled from the first step for each loop :thinking:

The Construct statement properties are documented here.
Also as far as I know it is not for filling an existing assembly (you need TransportIn for that) but creates a new assembly every time.

I may be misinterpreting your design intent, but I think you may be able to achieve this more easily with an assembly:

How to complete an Assembly or Disassembly Task | Visual Components Academy

1 Like