How to create more than one Instance of an adaptive component



I have created a Dynamo file which places different adaptive components in my project. Running this once it formes one Element of the planned roof constrution.

Now I have this working for one Part of the roof and I want to create the other Elements.

For creating an Element I need three modellines.

So I create one element and then choose the next three model lines, running the code again. This leeds to the first element beeing deleted and only the second one remaining.

Now this problem somehow comes from inserting adaptive components several times, I guess?

Could you please tell me, how I can manage running the program several times without the old components beeing deleted?

I think it will be most difficult to redesign my program in order to accept lists of the three input lines, so I need another solution.

Please see annexed Screenshots and Dynamo File.

Thanks a lot already!

Best, Max

ScreenshotRoof elements




The best approach is to indeed redesign your program as it will minimze the amount of manual labour. Running the same graph over and over again does not seem sensible - you’re looking to automate your workflow, right?

To get you started, here’s an example of how you could organize the placement of multiple adaptive components (in your case it looks like they have six placement points). The custom node in the graph is from package Clockwork.


And the DYN file: PlacingMultipleRows


Thank you very much - that teaches me a lot about how to restructure arrays in the dynamo program!

But what I am still interested in, is why running the same code twice will lead to deleting the created Objects from the first run.

Is that according to the naming (ID) of the placed components?


That’s just how Dynamo works. It’ll remember the objects it has created in Revit. The advantage is that you can re-run the same graph with updated parameters on the same model again and it will usually just update the elements it has created in a previous session and not create new ones (no new IDs). The downside is that it becomes a little harder to re-use the same graph on a different part of your model. (The trick is to delete the node that created the elements in Revit and place a new instance of that node in your graph and rewire it - that’ll force Dynamo to “forget” the elements it created previously.


Ok, thanks! I somehow feared, that this would be the answer… But at least now I know the background now.