Assign variable object coordinates via slider

Hello everyone,

i need some help as i don’t really have an approach to my problem.

I would like to carry out an optimization with Generative Design. For this purpose I have put down 2 sliders, which should be used to determine the coordinates of objects. Several objects are to be selected via “Select Model Elements”. Now I would like to create a kind of loop or something similar in which a position is assigned to the objects one after the other via the slider. This should work with any number of objects. At the end, a list of objects and the associated coordinates should be available.

Thank you in advance!

I would like to help you but I have so many questions:

How do you detiremine the coordinates for the objects? You say you have 2 sliders shich should be used to detiremine the coordinates, but how do you detiremine them?

If you select several elements, but only have 1 XY location, how are the elements related to each other? Is there a relation to them, or do all elements need to get the same coordinates?

How is Generative Design involved in all this?

2 Likes

Hello,
the aim of the entire script is to define the slider as an input for generative design. By means of several runs, Generative Design assigns new points / coordinates to the objects over and over again using the slider. With the rest of my script, I optimize the transport intensity between the objects as output (this depends on the position of the objects). The objects are in one plane and should all be assigned different coordinates for each pass.

I have another approach, where I can’t find a way to provide input for Generative Design …

So basically you want to Generate Random XY coordinates for an X amount of elements Selected in Revit. And you will evaluate these coordinates based on the transport Instensity (This is something you understand, I don’t).

But if you generate random coordinates, generative Design does not know how to reach an optimum, it only knows that 1 outcome is better then another?

Side note, Do you really need the Families in Revit? Cant you do the whole optimization in Dynamo itself and one you have the optimal, you can push the results to Revit (This will make it alot faster)

Basically it is as you described. I optimize by saying that the transport intensity should be minimized and that generative design should find the minimum in, for example, 30 runs.

I think the optimization can only take place in Dynamo :slight_smile:

Yes, but the only solution you will get is a random solution in which the minimum intensity is just the lowest number Dynamo Generated in 30 runs.

You will never (very small chance) get the optimal solution.

Example:

Lets say I want to use Generative Design to detiremine the lowest number in a range of 0 to 10 and I give Generative Design 3 runs and each run it will generate a random number (These are your coordinates).

GD gives me 3 in the first Run, 7 in the second and 4 in the third. GD detirmines that 3 is the lowest number in a range from 0 to 10, but we know the lowest is 0 ofcourse.

By Random Generating a number, GD cannot influence the end result. It can only generate random options.

This can be done by create an X and Y Slider for each family you have, but this would make the algorithm static to 3 items (or more if you create more sliders) Then GD can play with the Sliders instead of just random generating numbers

I understand your point. However, there are other factors that add to the solution, but they are of no relevance to my original problem. For my problem in factory planning and optimization, however, this type of optimization is sufficient in a special case.

I have already implemented it statically for 3 objects and only want to implement it dynamically for n objects. Is there no way?

Generative Design does not allow for a dynamic number of inputs based on a selection or any other variable. Each input has to be manually setup. If you have a limited but variable number of potential inputs you can set them all up manually but have your graph utilize only n number of those values based on your selection.

1 Like