Copying Objects From Linked File

In Revit it is possible to select elements in a linked model such as door, windows etc. by using the tab key until the correct element is selected. You can then use the copy (ctrl+C) and then paste an instance of the copied object into the parent project by using the paste in same place command from the modify toolbar.

I am trying to replicate this process in dynamo, so that I can do this with multiple objects at once. Below is my attempt but it keeps failing, it adds the families to the project but doesn’t paste the elements where they should be.

I have tried variations of this, once the families are in the project I have used dynamo to get the locations of the elements in the link then use these locations to place instances in the project. I had to translate the points using the link base point as this wasn’t the same as the main project basepoint even though both elements are in the same place in the project and are aligned by shared coordinates. However this still wouldn’t let me place the elements. I didn’t take a snapshot of this revised graph.




You may be able to do this without Dynamo, have you looked into Copy Monitoring in Revit?

It should be able to copy some elements from linked models. This is also good because I believe that if you change one of those elements it will either have you revert your change or ask the owner of the linked file to approve the change.

Unfortunately in 2016 copy monitor doesn’t work with windows. I want to bring in the families from the linked file in their current locations with their current instance parameters such as mark, I can then update the window families to suit their fabrication details which would then update the window instances accordingly.

I’m not sure if TurnIntoList is necessary. Try copying just one element first, then you can play around with handling multiple elements.

You might also want to check the CopyFromDocument node and see if it’s making any assumptions on which document the element is being pasted into. I’m pretty sure I had to create my own node for copying from one document to another, but I can’t seem to find it. You definitely have to be careful with element IDs and document management though.

Try turning the document into a list as well… With Python I am making the assumption that you are giving me lists. :slight_smile:

Also working on migrating a bunch of Rhythm nodes to c# for more stability. (Will release this soon)

1 Like

I have tried that, it’s still not working could it be a version thing? I am currently using dynamo 1.21

I have just tried this again but this time I have set it up for Curtain Wall elements as these do not need a host to paste into.

It has given me some strange results.It has pasted the CW elements into the project but they haven’t appeared in the same place even though the link and the project are perfectly aligned and both using the same shared coordinate system.

This may be the reason why the Window version failed. Any ideas as to whats going wrong?

Did you manually move the linked file?

No, I’m very careful when setting up a project because of the revit origin which you cannot access (0,0,0). I set this project up by opening my blank template, I inserted the linked file using origin to origin, then aquired the coordinates, then copy monitored all af the grids and levels before I started work. The only thing I can think of is that there is a problem with my template.

I’ll be honest. This workflow was kind of hacky, to begin with. Right now I am seeing and issue if the projects origins are off. Let me do some more digging when I have some time. I have been going through and doing quite a bit of node cleanup and this is definitely on the list.


Thanks John it is appreciated. I do think there is a problem with Revits internal base point (0,0,0), both dynamo and the ifc export use this rather than the project base point and survey point, these are handled by a translation in the ifc file. We have had problems when issuing ifc files that report the correct coordinates and align when brought int navisworks or tekla BIM sight but come back into Revit incorrectly

Of course! The thing I have been skipping is obtaining the link’s “transform”. I’ll add that and we will see if it helps.

Hi @Darren_Carver

Check the location of elements you copied and elements from linked file. Does it match?

1 Like

I also updated the node to take the link instance as well.

The new node name is “Document.CopyElementsFromDocument”.
This should obtain the transform and copy the elements where they need to be.

1 Like

Thanks everybody. I think that the items being placed differently than the link may be my fault. I have just opened my template and used dynamo to draw references from 0,0,0. this did not align with the project basepoint or the survey base point. Someone must have unpinned it and moved it. Hopefully this will resolve the issue on future projects. I will try the new node, thanks John, I will also report the discrepancy as suggested by KulKul. If there is a difference vector between the two, is there a way of fixing my project by translating all of the geometry in my project to the correct position relative to the internal base point (0.0.0) as moving the base point or survey point has no effect.



1 Like

A little bit more information. I have just opened the linked file and ran the script to find the dynamo origin (0,0,0). this is not in the same place as the survey base point or the project base point. so the way in which Revit handles coordinates and shared locations appears to be flawed in some way, this is leading to these translation errors. So hopefully John’s modified node that takes into account this translation will work. I think that Autodesk need to address this issue otherwise everybody who uses Dynamo must ensure that the project Base Point is coincidental with the Dynamo Origin (0,0,0) the only thing that should be moved is the survey base point, and the coordinates of the Project Base Point should be adjusted by typing the coordinates and not by moving the base point.

It would be also nice if there is a way to reacquire coordinates from a drawing (dwg/autocad) if for some reason after setting up the model in revit and you already set the coordinates and made an error and have to reset coordinates. Its a pain to reacquire the coordinates. Mind you this doesnt happens all the time but when it does it takes ages to reset coordinates and make sure all link models also have the new coordinates and appearing to the correct location. So in my office we always make sure first everybody is sure the autocad file we using to acquire the coordinates is correct and will not change coz if it does it will be painful task. Apologies if my comments is off topic…

In an ideal world the File Centre (or XYZ 0,0,0 in Revits Internal Coordinates) should be coincident with the PBP. In most cases though this won’t be the case, especially where Shared Coordinates have been assigned after a project has started. Hence, any translation which uses the PBP to translate or transform must be aware of this scenario and compensate any difference from the File Centre otherwise it’s the process in Dynamo that has the problem (or ‘flaw’ as you put it) and not Revit!

The File Centre, PBP and SP if understood and used correctly, make the Revit coordinates system far more flexible than CAD applications that only use an auxiliary CS.

EDIT: for clarity, the Dynamo origin which you mentioned is actually Revits File Centre.

1 Like

The updated node did the trick, Thanks for all of your help John.


1 Like