Repeat Action

I’m quite new to Dynamo so I have a simple question. I have a string I use to generate a solid, I want to repeat this string by using a number slider to control how many times I want to generate the solid. How can I do this

A loop in Python.

List.Cycle

Sorry I may have called it the wrong thing. What I have is a collection of nodes to generate a solid. I connected it to list.cycle, but when I adjust the number slider, I don’t see the extra solids, even though the output is showing correctly.

You’ll get a list with your string repeated.

Post a picture of what you’ve done, that may help us understand.

So what I want is to recreate this shape. The original shape is made by generating random values within a range for the points. I want to recreate multiple copies of this shape, all with random values. For some reason I can only create two, no matter the value on the slider, and the shapes don’t seem to be different.

Creat your custom node with an input so that a value causes the random shape to generate. Then feed it a list of values from a List.OfRepeatedItems node.

Note that after you generate the shape the geometries will all be on top of each other, and as such to see them you may have to use a Geometry.Translate to shift the elements around so that you can review the options.

Ok thanks a bunch. What do you mean by creating a custom node, I thought I already did (Facade). I’m really new to Dynamo, as we only have a six week course at school. What might that input be?

Ah, you want a range.

You’re only telling Dynamo to recreate your original at 1500 away.

What you want to do is recreate it at 1500, 3000, 4500, 6000 and 7500.

etc

Oh, add one for how many too:

image

A = first picture

Edit the custom node and add an ‘Input’ node. It doesn’t even have to be connected - just being in the node will create an input to allow to to trigger the node repeatedly.

How we if you can figure out how to control the randomness and how to evaluate the result via code then you can move from ‘generate a million things and hope I see one which I like’ to ‘teach the computer generate options and evaluate the outcomes in a evolutionary manor until we find an optimal form’. Basically moving from ‘design by rolling a dice’ to ‘design to the outcome I want to achieve’ by way of generative design.

How to make the code inside the custom node do that is another question entirely, and not something which one can do without more context.

This is actually a good length of time and more formal training than most! You must be at a good school. :slight_smile:

Ok perfect thank you!

Ah I see. I still have some issues understanding how this works.

Is this what you meant? The sliders are changing the shape, but every one of them is the same.

1 Like

Yeah - we need to see what is happening inside the custom node to understand why that is the case.

It is likely that you don’t need it as a custom node though, specifically if you want to move to a generative design workflow.

Ah, you want random numbers to generate the shape too?

Replace the list of repeated item with a random number generator… but make it give you several random numbers (the blue R in a circle)

The second bit I’ve crossed out. You are multiplying by 1 - that’s not changing anything.

Depending on the contents of the custom node that might not do anything… if the ‘generation’ isn’t tied to the input then it doesn’t matter what is provided - periodic run mode with a DateTime.Now would make a new one every second, but you’d never get a result twice.

Yes… But I’m assuming brya0183 knows their code well enough to tweak to suit…

What’s that I hear you say?
Never assume?
:stuck_out_tongue:

Haha, thanks for that assumption. To be honest my code is probably a mess, but here’s a short rundown because I can’t upload it yet:

The solid is controlled by six parameters, each with a slider for min and max value. A Math.Random node is used for each parameter to generate a random value between the min and max value.

These values are then connected to multiple Point.ByCoordinates nodes, which is then put into a list. The list is connected to a NurbsCurve.ByPoints node, and then Surface.ByLoft. Lastly the surface is thickened and connected to a Geometry.Translate node.

Just to be 100% clear, what I am trying to acheive is to generate multiple copies of this solid by repeating the process mentioned above, but each with different generated values for each parameter. Thank you guys so much for the help.

Bumped your trust level - should be good to post files now. :slight_smile:

Once you have the solids, what next? Are they all going into Revit as a building or element thereof? Are you going to select one and implement that? Is the totality of all the custom elements becoming a larger assembly?Something else entirely? If eventually only selecting one what will drive you to select that one?

So the six week course I mentioned is a part of my architecture studies. I will be designing a facade cladding using parametric design in Dynamo. The concept is a vertical cladding elements resembling waves, placed with a gap between each cladding. Each cladding will be a different wavy shape. The solids will be placed into Revit as wall elements, placed on the outer side of the structural walls. Hope that provides a better understanding :slight_smile:.

But here’s the custom node:
Facade.dyf (96.9 KB)

1 Like