MOVE ALL ELEMENTS from a certain LEVEL to a DUPLICATE and RENAMED TYPE

Hi everybody,

First of all, I’m totally new with Dynamo and my English sucks a bit.

Im trying to set a code in order to:

  • Select all Elements from certain level (Underground Leves in this case)
  • Get their Element Type in order to duplicate it and rename it with same Name but addin a Prefix (UG_)
  • Move the preselected elements to this newly created and renamed Type.

The point is that i have got some elements like doors and windows done but some others like walls and Slabs dont.

Any idea?

Because you start with all the Wall Instances you have the same Wall Type multiple times in your Type list. So you’re trying to Duplicate the same Type into a new Type with the same name multiple times, that’s why the first Wall is successfully duplicated and the next 3 are not.

I would grab the elements, grab their Types, use a Unique node, duplicate those Types and store them in a Dictionary (Name old Type - New Type as revit element ).
Then grab your list of elements, ask their Type Name, ask the Dictionary what their new Type should be and set it with the Node you already have.