Generative Design - Randomise Windows (in Curtain Wall)

Just trying out Generative Design for the first time and would like some help if possible. The attached graph exports but just sits running forever and doesn’t present any outcomes (I can see the .json results file updates its timestamp every minute so it’s not frozen but it never creates any outcomes).

I’m not sure if what I’m attempting to do can actually be done with GD.

The graph is a bit long winded but what I’m doing, in a nutshell, is grabbing all types of a window family and their IDs. I’m also selecting all windows in the project and filtering those to grab particular facade elements. There’s some rules applied to which can panels can be swapped and then the list get randomised and I have data gates before the actual swap family instance (using the type IDs I gathered earlier). The only output is a count of the units (apartments) that are having their facades changed.

So, basically, a randomised facade. What I’d like, is for GD to present 3D thumbnails of the various random solutions it comes up with.

RandomiseFacade_GenDesign.dyn (228.0 KB)

Maybe stupid questions but…

Have you set input and output nodes?
Have you tried running it on a tiny amount of population size/ generations?

Generative Design has no access to the Revit API, and as such any node which interacts with Revit will return a null. Then all subsequent nodes will also return a null unless there is a Data.Remember node which ignores the null and passes the previous data onto the calculation. Remembered data can be just about anything, including geometry.

To see this for yourself, open your graph with Dynamo Sandbox, which won’t have any association to the Revit API just like Generative Design. Where your graph is failing to process will then be apparent.

Thanks Jacob, I wasn’t aware of that limitation. I’d assume swapping, rather than placing a family, will need an API call but I can always just output the seeds used to generate the preferred scheme.

So I’ve had another go but I still can’t get GD to do anything but sit there spinning.

I still have Revit API calls but these are all upstream of Remember nodes. Judging by the size of the graph that gets saved I would assume these are working.

Is this the correct workflow? Ie - the exported graph can have nodes that access the Revit API as long as they’re placed before Remember nodes? Everything else that happens in this graph occurs within Dynamo.

What I do now is:

  • Get the geometry of the window families (remember it)
  • Get all the type element IDs, a unit number parameter and family names (remember them)
  • Based on the above, filter, group, randomise and colour Dynamo geometry.

The .dyn is too large to attach now but here’s the screen shots of the graph.

Sorry in advance for the wall of text. Not many other good ways to do guidance at this scale.

Break your graph into four sections: gather, compute, evaluate and record. Since your evaluation is purely aesthetic and based on a random shuffling this isn’t a great overview of all parts of GD. As such I’m going to shift your proposed example and use a patterned sort with a List Permutation method and a a goal of maximizing the open glazing in key rooms while minimizing the solar gain on the facade. This loosely follows a webinar outline I’m working on for the accounts I support, so while I can’t share the ‘here’s how’ graph yet, the outline and my commentary should guide you along. I recommend starting by saving your graph with a V0.0.1 suffix.

In gather you can interact with whatever you want. Revit, Civil3D, etc. this phase should always terminate in a remember node (or series of remember nodes). Think of this like packing the tools you need to build a treehouse - if you don’t bring the hammer you won’t have much use for the nails. In your case you likely want to remember stuff like:

  1. the geometry of the window family types in an orientation that would match a coordinate system on your populated surface.
  2. the host surface geometry and local coordinate system for each windows you want to vary
  3. the required context geometry to visually evaluate your design.
  4. the index of ‘key space’ windows.
  5. the percent glazing on each window type.
  6. the family type element IDs.

In compute you will use the data in the ‘gather’ phase, and your inputs to produce a design. For inputs you might have a number slider for the mix ratio of each type of glazing unit, and a permutation number to control the sort order was the top performer - rename both sliders and set them as inputs. You would then apply the mix ratio on the units across the total number of panels so you get at least as many panel geometries as you have panels in one list. Then use the permutation value to sort the panel geometries into a new order. Then apply the list of coordinate systems to the list of window geometries. The design should now be assembled and visible, but you likely want to hide all the geometry and use some Geometry.Color nodes to make it more appealing and easier to understand. Notice there was no call to Revit at all during this phase - we just let Dynamo work with Dynamo content.

In evaluate we need to ‘score’ the design which resulted in the compute phase. We’ll assume that all units have the same orientation to the sun, and that 100% transparent opening would have a solar heat gain value of 10 and a 0% opening would have a zero. The evaluation is as simple as adding the area of the glazing on each window (remember to apply the same permutation and mix functions on that list!) and and divide by the total wall area. To evaluate the key space views we can grab the % opening at the remembered indices from the gather stage, and take the average. Wire the % key area and overall % opening into two renamed watch nodes which are set as ‘outputs’.

Last in the initial authoring we have the record phase. This involves moving it back to Revit once you feel Generative Design has found a suitable outcome. Take the same mix value and permutation data as you used in the compute stage, and apply that to the family type ID values. Wire this into a Data.Gate node, and set it to ‘open’ for now. Next take the outcome of that and move the result into a select by ID node. This will give a matching family type for each window in the resulting Dynamo geometry which was evaluated. You can now apply this family type to the original list of window instances. Close the Data.Gate and save the graph you’re almost ready to export.

From here save the graph as a new file with a V0.1.1 suffix, run it once more, add and remove a note, save again (all this to ensure you get serialized data in your remember nodes) close the graph in Dynamo for Revit and open it in Dynamo Sandbox. The graph should run and give you geometry as well as evaluations (watch the watch nodes) for any mix values and any permutation value. If anything fails look into why. There should be no ‘unresolved’ or other warnings between the Data.Remember nodes and the data gate node unless they are edge case related, such as proofreading empty lists or passing the occasional null. Clean those up in Dynamo for Revit, or not as you see fit. Remember the more unaddressed edge cases the more likely you never get results as Dynamo will struggle to avoid those issues. If it all works, close the graph (don’t save it) and reopen it in Dynamo for Revit. You can now export the graph to Generative Design, and test in there. Do a small 10 sample randomization. View those results and see how things look. Then try a cross product study to see how the outcomes on the limits of the design space run. Then try a 8x8 optimization run. If all of those worked out, it’s time to move onto a bigger study - say 100x100 or 20x20 optimizations. Let that sit - walk away, quite literally if you must. Check periodically and see where things are - when done explore the results a bit and decide if you want to do another large or larger study, or if you want to commit a result to Revit.

2 Likes

How does this version of the graph execute in Sandbox?

Thank you for the detailed response, Jacob!

Stupid question - how do I install GD for Dynamo Sandbox? Pointing to the package path doesn’t seem to be enough as the Remember nodes return null values.

I was able to get my testing sample to work (comprised about a third of the facade) but exporting the full facade still results in fails. It does run in Dynamo for Revit with everything upstream of the Remember nodes removed (so isn’t dependent on the Revit file that is open) and I’ve cleaned up all the empty/null list cases I can find - at least none are being passed to the geometry nodes.

Whilst this study is being run on a purely aesthetic basis, the rules were already based around required energy efficiency of each apartment. We have a specific mix of light and dark glass panels that we can use and also need to retain the locations of opening panels - these constraints are hardwired into the graph rather than being inputs.

1 Like

Copying the package directory from the D4R folder to the Dynamo Core folder should be all it takes but I haven’t had to do this for awhile. Give that a shot and make sure you’re not loading packages from both (as that can cause issues) and that you don’t have an older version or Refinery in the same library.

Unfortunately that doesn’t seem to work. The workspace references say I’m missing GD 1.0.1 and the nodes return null values despite them appearing in the library on the left.

I’m still stuck with GD not returning results - not even for the smaller sample set I had tried earlier so I’m wondering if there’s some other issue. The graph is fully self contained now and doesn’t present any nulls. It only operates on remembered geometry and data and doesn’t attempt to push anything back to Revit.

Do the samples work?

Good point and that’s a no!

When I try to select an object in Revit using one of the Select in Model tools I click on the instance and nothing happens. The select command stays active and I need to quit Revit. When I run one of the samples that doesn’t require a selection I get the same issue that I’ve been having where it never generates an outcome.

I’ll try uninstalling and reinstalling and see how that goes.

Grab the Server log file associated with the runs - they should be in the same folder as the study exports or outcomes (o forget which). I can try to check later if you can’t find it.

Hi - the only files I can find are the .json files in the Results folder. Here’s the ones for the ThreeBoxMassing study. Please remove the .rvt suffix.

ThreeBoxMassing.zip.rvt (14.3 KB)

Edit: some further study. I tried GD on another machine that hadn’t been updated with the 21.6 installer and the samples worked. I then updated GD to the current version and the samples stopped working.

Edit2: some even further study. Looks like killing the Generative Design Compute Server process after I shut down Revit allows the samples to work again. Doing this it runs the samples and the small test facade graph I exported but gets hung up on the full facade (which is a 61mb graph with all of the cached data).

But… what if the end user is using the shiny new tool in Revit 2021? Can it not interact with Revit elements?

Correct - each study has to be able to run independent of Revit interaction. This is why the Data.Remember node serializes the data to the graph prior to execution, and the Data.Gate node prevents execution of the nodes which push the results into Revit.

1 Like

Ahh. My fault. I must have dreamed about this graph that doesn’t use the remember node or gate node and creates real Revit elements (modifying curtain wall grids in this case).

  1. Using Generative Design for Revit we are iterating through the grid line removal.
  2. Between each run I undo so I can see the results in Revit instead of the Generative Design™ window.
  3. When I like the result I accept it and move on.

i wish you all would stop trying to say dynamo isn’t for revit these days :roll_eyes:. You are so desperate to enforce that agenda that it is muddying up some pretty excited ideas from people.

And I will just leave this source graph here as well:

*Note: the above screenshot of a graph is provided as-is as a proof of concept and illustrates a “hack” to use the generative design tool in ways that are not efficient and also hurt @jacob.small’s feelings.

So… you took the optimization tool and used it to randomize data via seeded values? How does that help the process when there is no numberical value, a randomizer which runs a study with:

  • No output for a quantifiable evaluation as your output always returns null in the add-in.
  • No display to show the results for a subjective evaluation as you have no geometry in the add-in.

Yeah it “works” in the sense that Revit is modified - but only by blind selection. Effectively you’re using Generative Design to run a graph in Dynamo Player, and adjusting the input value until you get a result you like… Certainly there is value in not having to change the selected CW which you randomize every time (which come to think of it would be a good add to Dynamo player), but not at the level of ‘let me review 100 of these side by side and pick the one I like best’ which is the point of Generative Design.

Granted it could be built out further to run the evaluation and results in parallel after adding in the Remember node… but at that point it’d be half the graph you built and half the graph I discussed above (which I’ll try and find time to put together later and post here).

¯\_(ツ)_/¯

Good enough for me. :running_man::dash:

image

I’ll look at sharing this graph later, perhaps in a webinar or other format. It’s pretty simple and works in 2020 and 2021, but I have a few changes I need to complete first.