How to move the box to its original position?

I have randomly placed blocks that I need to move to the origin. I want to automate this with a grasshopper. Can you tell me where to start?
box.3dm (146.5 KB)

Yes - there are numerous ways to work on this. One usually-reliable way for ‘regular’ boxes (not twisted/deformed) is to (1) deconstruct the box, (2) grab its largest face, and (3) use that as the plane to orient from.

Another option is to use that same plane from the box’s largest face to create a bounding box for each box and evaluate it. By evaluating the bounding box you dictate where the base plane is positioned vertically prior to orienting.

See the examples here:
orient_box.gh (37.4 KB)

1 Like

Thank you very much. How I love this forum )))

1 Like

Also:
If you intend to move those displaced boxes back to the original boxes (as your title implies) then you can sort them based on their size and go from there via orienting or box mapping.

Here’s an example of that:
orient_box-mapping.gh (21.4 KB)

OK, thank you

You’re welcome.