Moving elements from main model to Design Option with Dynamo


I would like to create a dynamo script that allows to move elements from the main model to a design option AND get the new elements IDs. I tried to use the PostableCommand.AddToSet node (python code) but it doesn’t give me the new IDs of the elements moved.
In Revit, when you move an element from the main model to a Design Option, it copies the item and gives it a new Id, which is blocking me for what i want to do later.
My goal is therefore to get the new element Ids and replace them with the old ones, so that the same element in the main model and the design option will have the same Id. Therefore, i would be able to compare both items.

Can you maybe help with this script ?

When I move an element to one option I don’t get a change in ID - are you copying to multiple options?

I always copy the element to the principal design option and to one or multiple secondary options. The element ID of the principal design option doesn’t change, but it changes for the same element in a secondary design option. I would like to have the same ID for the same element in the principal and secondaries options.
I don’t know if i’m making myself clear. Please let me know if not.

Sounds clear to me, but you’re thinking of the objects in design objects as one element, but in fact each object can only be assigned to one design option, and as such you have a Unique ID (GUID) and Element ID (ID) for both objects which will not align.

As far as I know, it’s also not possible to ‘tie’ the object in one option to the object in another - that is building a way to always select an associated element in another design option when you select an object in one option. While you can write a parameter to be a consistent GUID/ID in object 1 to be in other objects when copied into the design option, as soon as a user start filling out the option you’re going to get discrepancies (ie: copy the wall 5’ east and your parameter value will be linking BOTH elements instead of the original (which is all you’d want to maintain in the long term).

There might be a way around this via building out your own ‘faux copy-monitor’ but that is going to be a LOT of work and will require the use of a custom extensible storage schema right from the start, and will likely be best managed via a full add-in rather than a Dynamo managed version.


First, thank you for your answers.

What i would like to do is have the same ID for an object in one design option but for all the options of this design option. I was thinking about creating a new parameter called “ElementID” that will be the same for an object in the principal option of one desgin option, and in the other secondaries options. I would read the ID of the object in the principal option of the design option and copy it in the right parameter for the objects in the secondaries options.
But i would like to be able to do that every time the user moves objects from the main model to the design option. I thought about using the location of an object to be able to compare them in order to match the same objects and apply the same ID.

What do you mean by my own “Faux copy-monitor” and a full add-in ? I’m quite new in Dynamo and Revit.