Hi i am working on a dynamo script with OOTB nodes. My goal is to select multiple instances in active model and align each of them to their closest walls. The closest wall is in linked model.
My step is:
- Picking input instances in active model, and “wall” in linked model
- Finding the 4 nearest walls (by linked element in ray bounce, bimorph node) with direction x,y,-x,-y
- Looking for the wall with shortest distance from my input instances
- Getting closest wall surface and its isoline
- Getting Rotation of isoline
- Finding the closest point from the original instance and the reference face, setting the new location, adjusting z coordinate
So far the script works well with 1 instance, however when i want to multiple instances, it doesn’t work and the instance all align to the same wall.
Any idea how to fix ?
Aligning Selected items to Wall - WIP r.5.dyn (115.5 KB)
With 1 instance:
With >1 instance: