Output Copied Elements in the Same Order They're Input

Hi I’m trying to use the Element.CopyByVector node from the Clockwork package to output New Elements in the Same list order that I’ve input them as.

I have multiple elements coming from circuits in the model. When I duplicate these elements I’d like to output a list similar to the one that they went in as. I’m newish to python and very new to python with dynamo. Can anyone help me solve this problem and possibly show me how I could change the script to get the output to match the input.

This is the python for the clockwork node I’m working with.

I’ve been trying to get it to create the output "elementlist)"as it loops through each element but I don’t even seem to get an output. Its difficult because there is nothing relating the new elements to their old counter parts, so the output list will have to be created in the original Element.CopyByVector Node

I know the element ids will be different but I’d like the “copied” elements to match up with the “pasted” elements in the same listing order.

I know its possible I just need to spend some more time on it. If you can help me along or need more information, all comments are appreciated.
Thank you!


I’m thinking I might be able to loop through each category with the copy node. I won’t have to output the elements in separate lists because they’ll output in they’re sublists one at a time

CopyandCircuitElements.rvt (680 KB)
PowerCopiedElements.dyn (27.0 KB)

I’ve attached the Dynamo file and a Revit file to test the program. The Revit file is 2016 and the python that circuits the elements is alos written for the 2016 API. This can easily be converted to the current API if necessary, just ask.

I know I’m very close. Currently I am trying to use a while loop to iterate through the list of circuited elements but it seems to only output the end result of the while loop rather than output each number.

The end goal is to duplicate elements on a panel board of my choice and re circuit all of the elements to a panel of my choice. I may start another post if I don’t hear back from anyone.

I’m sure this program will be very helpful for any electrical designer who creates similar electrical layouts. I also know that there is probably a much easier way of doing this.

Any help is greatly appreciated! Thank you!

I figured it out actually. I just had to use list.map, I made Element.copybyvector as the function input and the element list as my list input.
Very useful node…

You’re right. It’s just a matter of level on the node.

1 Like

This explanation can be interesting :

1 Like

I had no idea about list level. I had always thought people were taking about the model height when mentioning level… Your method is almost more simple than list.map but it uses the same type of fix.
So many issues solved in one little feature!