Copy / Paste Elements

Hi Guys,

Hoping I can get some relatively quick help.

I can create elements in dynamo for revit but the issue I am having is copying elements that are in a linked file, and copy them into my current file.
Such as, we have a architectural file linked into our structural one, and I want to simply copy and paste that floor into our model.

I can successfully Copy the floor, select it, all of that, I just can’t figure out a way to paste it in. Is there a node package that I am missing?

Hi @aclothier

3 Likes

Hi @Kulkul

That’s great, worked perfectly. Not entirely sure how but that’s really good.

Greatly appreciated!

Thanks for the quick response

Hi @Kulkul

Just wondering if you have a solution to this:

Everytime I reopen the dynamo file, it re-copies the elements everytime and then puts duplicates into the model. Is there a way around this?

Thanks!

Hi Alex,

Try to save the dynamo file after running it.

Hi Salv,

Its still doing it unfortunately. Currently its re-copying and pasting the elements again.

Then the only way I can think you could achieve that,is to store the Ids of the elements you are copying. Either export them to excel or write the ids to a project parameter and check against them before you copy.

How to copy paste in same place ?

This python node copy and pastes in same place and same view. Not sure I can do any better but maybe some else on here can improve the code.

code that modifies revit database goes here

itms = UnwrapElement(IN[0])
actv = UnwrapElement(IN[1])
#site = UnwrapElement(IN[2])
output =

for itm in itms:
col1 = ListElementId
col1.Add(itm.Id)
itm = ElementTransformUtils.CopyElements(doc, col1, XYZ(0,0,0))
output.append(itm)

COPY AND PASTE ITEMS.dyn (4.8 KB)

Thank you @simon_murphy1

but I tried different way it works.

Thank You somuch.

Can you please provide Element.CopyFromDocument dyf file.

Hi @pavancad,

The node you are looking for is in the Rhythm package.
I think it has a new name “Document.CopyElementsFromLinkedDocument” .

Hi @MJB-online,

I was looking through my Rhythm directory in Dynamo, and I couldn’t find that node “Document.CopyElementsFromLinkedDocument”. Any updates on if its still supported in the latest version of Rhythm?

Thanks!

Hi @BoraG,

I don’t have the latest version of Rhythm at the moment, so i don’t know.
Maybe @john_pierson can tel you if the node still exists or not.

1 Like

Still in latest version.

Rhythm is supported on Revit 2017+ and Dynamo 1.3.2+ (limited 2.0 support right now)

If you are still having issues, manually remove the Rhythm folder from your packages location and install fresh from the package manager.

2 Likes

Hello everyone!

I’ve got a problem with this script.
I wrote it as like you advice on top:


Script works, but with warnings; windows are copied, but aren’t in right location.

Do you have any ideas why it isn’t work?

Best wishes
Jadwiga

I am imagining that you are using a link and have moved it somehow. I would try the other node. If you have more issues, please open a new topic.

I use the Springs version as it includes any transform from a rotated project north etc…

image

Hope that helps,

Mark

Hi I wrote the script it worked it is not showing that it copied and pasted on my Revit Project
image