General question. I have two groups of families stacked next to each other and I’d like to blend them. Is that possible in Dynamo? I was able to do it in Grasshopper without much effort but I’m not sure where to start with Dynamo…
What did you do in grasshopper? You should be able to follow the same general logic even if the nodes aren’t exactly the same.
There are a LOT of ways to do this. Personally I might tackle it by shuffling the sublists, and then using a List.TakeItems node with a range from zero to the number of sublists I want the blend over as the number of items input. Then you just need to set the family type and you’re done.
@Nick_Boyts: pretty much @jacob.small’s method.
@jacob.small That’s interesting because that’s’ very similar to how I did it in Grasshopper -although it was many moons ago… Just curious: what are you treating as sub lists in this case and how would you build them? I think I can fifigure out the shuffle part…
Thanks guys!
The sublists are the columns which your design is segmented into.
As far as how I would generate them… Well, that depends on what my starting data set is.
If it was newly placed content (ie: I populated the families in the model from scratch) I would make the points in rows not columns. Assuming these are desks in a plan view, Point.ByCoordinates with the sequences of X and Y values to build the grid, but make sure the X input is set to use Level 1 (@L1) as otherwise you have rows instead of columns. If the pattern needed to be on another plane I would likely produce it this same way, and then use a coordinate system to transform them into place.
If it was existing family instances I might group, then sort by the distance from the plane at the patterns normal and V axis, then shuffle.
Or maybe they are curtain panels in which case I would get the closest point from the panel on the curve which defines the wall, then find what the parameter of the curve is and sort all the panels by that, perhaps using a rounding method to ensure I have the right number of groups.
Or maybe they are supposed to be newly created by spreading points over a surface, and I would use UV parameters with list levels set similarly to the point example generate them…
Or maybe the intent is to break the surface into panels in Dynamo…
Or maybe I would use bin packing to set the list of colored or uncolored solids into the evenly spaced containers, increasing the percentage of colored solids as I go.
Or maybe I would use VASA to segment a complex surface into voxels, generate random points in the UV domain scaling up the number of points as I move along the U axis, find the voxels at each point, and remove them from the base set, then convert the base set and odd set to solids and intersect with the overall surface…
Or maybe I would use generative design and let list permutations compare the total sum of colors in any column/row to an idealized gradient represented as numeric values.
Or maybe a Python node, pulling in random, math, itertools, numpy, etc to segment the space.
Perhaps use a computer vision library like OpenCV to offset the tools against that gradient idea, but using an actual image as the basis of design…
Maybe a new DLL brought in as a zero touch node.
What if…
Likely you get the idea: there are more ways to accomplish this then there are hours in the day to describe how. The best part about using code to create is that you have limitless options for how to accomplish a desired outcome.
Here’s one example, with some added complexity in triplicating the column counts:
Thanks @jacob.small , as always your posts are extremely informative and helpful and give lots of food for thought!
Unfortunately I’m starting with this:
existing family instances I might group, then sort by the distance from the plane at the patterns normal and V axis, then shuffle.
I wish it was newly generated, then I would have more control from the script but I think I can make it work. You mentioned “v axis” - did you intend y or x?
Thanks!
@sascari check this out if interested, it’s using curtain panels, but it can be applied on placed components as long as they are logically sorted :
Thanks @Elie.Trad I think this is key in your example
as long as they are logically sorted
Mine are already placed instances. However, I can’t ever get them to do a simple shuffle
@sascari which Revit/ Dynamo version are you using?
@sascari it is time to upgrade then:
Maybe I am wrong, but the List.Shuffle
did not work for me in Revit 2020, and it worked in Revit 2022 (Dynamo 2.10)
Might help if we had a file that has the sort of setup you have.
Offhand it looks like you have pavers, perhaps as point based families?
That would work as the distance from plane or as the closest point on a line converted to a parameter… I’ll see if I can find time to build one of those this weekend, or perhaps on my lunch…
Thanks @Elie.Trad I’ve tried upgrading but it’s a bit confusing (see screenshot) and the wiki isn’t clear what to do with a zip folder after I download it… I might be dense but perhaps they could simplify it a bit…
@jacob.small Thanks any help is greatly appreciated. Like I said: working with existing elements. I was hoping to work my way towards a proximity variable element (such as a line) but I can’t even do a simple shuffle atm. Thanks again!
Test Paver Path Array.rvt (608 KB)
Paver Blend.dyn (23.3 KB)
There is no way to upgrade Dynamo for Revit from 2020 on - upgrade Revit and your Dynamo will upgrade.
The List.Shuffle appears to be doing what it should, but you can always test with something a bit easier to tell. In a code block type “A”..”Z”;
.
Then wire the results into a List.Chop node, with a 5 as the second input.
Wire that into a List.Shuffle. Keep lacing on Auto, and see what happens to your list. The alphabet shouldn’t be continuous anymore, as the order of the sublists should be different even though the letters inside the sublists are sequential. .
Next change the list level for the List.Shuffle to @L2 and. The sublists themselves should be in the same relative position, but the letters inside them should be scrambled.
The bigger issue is the lack of grouping in your list - you just have ‘type a’ and ‘type b’ rather than the rows. Geometrically clustering them has to come first.
@jacob.small Feeling good about myself!
I was able to get the basic shuffle to work. Now, on to my next step: Controlling the intensity of the shuffle by proximity (such as an object or line). I’m uploading my files in case anyone wants to give feedback thanks!
Test Paver Path Array.rvt (604 KB)
Here’s what I was thinking for strategy:
- Get distance of each object to the point of reference (object or geometry)
- Sort by length
- Chop into sublists
- Shuffle each sublist
Right now I’m stuck at the Geometry.DistanceTo node and unsure how to proceed. Do I do a List.Map to associate the distances with each element?
Paver Blend.dyn (53.8 KB)
For this, I don’t know if I would use the same method. Your distances are already associated, just in separate nodes.
Instead a Math.Random and then a weighted multiplier based on that distance you mentioned, followed by a>x test, a List.FilterByBoolMask, and finally set the color. I’ll post a sample which uses sliders to control the endpoints rather than an objects distance later today.
Ooo. I like your strategy better. I’m going to keep tinkering with my method but I’m really curious to see yours as well. If I give up on my method I’ll start developing something with Math.Random instead.
Ok. I didn’t get very far, but I was able to at least sort by distance, of which I’m feeling pretty proud. I used a element overrideinview with a manual slider to test it out (I couldn’t figure out the color range node to work). On to the next step.
No promises, but I may do a demo build of this graph on this week’s community conversation. Just need to make the time work and confirm the build time.
If not then, I’ll post it here.
Feel free to register in advance: Dynamo Office Hours - Building with Dynamo - Autodesk Community