# Change model elements location

**URL:** <https://forum.dynamobim.com/t/change-model-elements-location/52825>\
**Category:** Uncategorized\
**Created:** [July 10, 2020, 12:33am UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825 "2020-07-10T00:33:15Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 10, 2020, 12:33am UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/1 "2020-07-10T00:33:15Z")

</div>

Hello,  
Is there any way to deal with the model elements as one element ?  
For example, I have a model for a house which consists of floors, doors, columns … etc. and I want to move the whole house by changing its location several times. could this happen in dynamo?

---

<div class="post-metadata">

**Author:** ![d.kuurman](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@d.kuurman](https://forum.dynamobim.com/u/d.kuurman)\
**Post date:** [July 10, 2020, 8:22am UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/2 "2020-07-10T08:22:14Z")

</div>

First of, why wouldn’t you just group everything and move it as a group?

Secondly, if that doest work, you could try to create a view with only the elements that need to be moved, then use the all elements in view option in Dynamo to get all of those elements. Now you have everything and you can move it to a new specified location by either translating all of the elements to a new location or calculate the new location for every element and move them to that location.

I wouldn’t recommend using Dynamo for something like this since it will probably be a all or nothing solution (if Revit gives an error because of one single element the whole opperation breaks). It can also get quite complicated to make something like this if you have a lot of objects with different dependencies. Think of wall- or facebased elements.

If you do really want to do this with Dynamo, please post some screenshots of what you want to move so the comunity can get a better idea of how to approach this.

---

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 10, 2020, 7:56pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/3 "2020-07-10T19:56:11Z")

</div>

![Captureee](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/6/d60e3864de42fe8fa782ad60ae9ee47661eb9edf.png)  
It’s about this node. I tried to make section box moves away from the model so I could have images for different sections but I couldn’t because section box has no parameters so I thought I could do this with model elements.

---

<div class="post-metadata">

**Author:** ![Bjorn\_Keulemans1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bjorn_keulemans1/32/54676_2.png) [@Bjorn\_Keulemans1](https://forum.dynamobim.com/u/Bjorn_Keulemans1)\
**Post date:** [July 10, 2020, 8:07pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/4 "2020-07-10T20:07:00Z")

</div>

Do it with your building as a Linked File. That might actually work.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [July 10, 2020, 8:09pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/5 "2020-07-10T20:09:04Z")

</div>

Just use shared coordinates and link your model of that house, possible link it multiple times with different locations and rotations/elevations.

---

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 10, 2020, 10:56pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/6 "2020-07-10T22:56:45Z")

</div>

![Captureee2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/a/6a30689a94f0bef466932ccbbf84893caf4edc9a.png)  
I’m still can’t find a parameter for the location which I could give it values.

---

<div class="post-metadata">

**Author:** ![d.kuurman](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@d.kuurman](https://forum.dynamobim.com/u/d.kuurman)\
**Post date:** [July 11, 2020, 12:23am UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/7 "2020-07-11T00:23:31Z")

</div>

I’m not sure if this is what you’re looking for, but you could move the linked model relative to it’s current location. This would circumvent you having to set a location parameter.

 ![Element Relative Move](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/9/f9cb685a97ad666e2297a35240fbd9f6b9b753df.png)

I wrote a quick python script to use the move function.

The code in the pythonscript is as bellow.

```
#This script is written by D.Kuurman
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
OUT = list()
input = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)
p = UnwrapElement(IN[1])
ElementTransformUtils.MoveElement(doc, ElementId(input), XYZ(p.X,p.Y,p.Z)) 
TransactionManager.Instance.TransactionTaskDone()
```

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 11, 2020, 2:25pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/8 "2020-07-11T14:25:11Z")

</div>

This might help: [Dynamo Dictionary](https://dictionary.dynamobim.com/#/Revit/Elements/Element/Action/MoveByVector)

---

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 11, 2020, 11:35pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/9 "2020-07-11T23:35:39Z")

</div>

![{3D}](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/f/8ff05513f5b5197c450fa85e3a6198be58c77adb.png) ![{3D}_0](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/6/96a39671a97878952bfd5264f02dc8ab1a226045.png) ![test1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/d/fdb3b40ad33a9d1df2f656a8a37ab0d5f7c4d7ef.png)

OK guys there is a progress. I could now move the linked file by this code for a certain distance and direction so I can have only one picture as you see and If I tried to do the operation manually and run the script again to move the linked file again and get a new picture The old image will be replaced by the new one.  
Any ideas?

this is the code :  
"  
import clr

clr.AddReference(‘RevitServices’)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

clr.AddReference(‘RevitNodes’)  
import Revit  
clr.ImportExtensions(Revit.GeometryConversion)

l = UnwrapElement(IN[0])  
v = UnwrapElement(IN[1]).ToXyz()

doc = DocumentManager.Instance.CurrentDBDocument  
TransactionManager.Instance.EnsureInTransaction(doc)  
OUT = l.Location.Move(v)  
TransactionManager.Instance.TransactionTaskDone()  
";

---

<div class="post-metadata">

**Author:** ![Allard\_DStudio](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@Allard\_DStudio](https://forum.dynamobim.com/u/Allard_DStudio)\
**Post date:** [July 12, 2020, 5:01am UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/10 "2020-07-12T05:01:17Z")

</div>

Hello Hossan,

I do not get completely what you want to accomplish. Do you want to move the house in the model where you are working in or do you want to move a linked model? And what is your goal? For which reason do you want to move it, or do you want multiple copies of it?

I think that when you give a little bit more information we could help you more efficient.

---

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 12, 2020, 11:42am UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/11 "2020-07-12T11:42:32Z")

</div>

[![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8df3e86b8430147496392fe7b1bbf43a8f4d6485.jpeg "Revit Dynamo Section Box Animation") ](https://www.youtube.com/watch?v=n8BZJqT7v8Q)

This video is showing exactly what I want to do

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [July 12, 2020, 12:06pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/12 "2020-07-12T12:06:27Z")

</div>

search for the dynamator package

---

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 12, 2020, 1:32pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/13 "2020-07-12T13:32:06Z")

</div>

I do use the package but I have to modify the package node like the man on YouTube.  
please, look at the node in the video and look at what I posted here.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 12, 2020, 4:28pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/14 "2020-07-12T16:28:26Z")

</div>

The nodes in the video aren’t legible, so how you have to modify them isn’t clear.

Moving the section box with a vector is likely the easiest way but I am not sure that is doable.

---

<div class="post-metadata">

**Author:** ![hossam.amer666](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hossam.amer666](https://forum.dynamobim.com/u/hossam.amer666)\
**Post date:** [July 12, 2020, 10:48pm UTC](https://forum.dynamobim.com/t/change-model-elements-location/52825/15 "2020-07-12T22:48:57Z")

</div>

Thank you all guys, you ideas helped me a lot. I reached about 70% from what I wanted to do in my script and it’s good for me in the current time.  
I really appreciate your help.
