Change model elements location

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?

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.

1 Like

Captureee
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.

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

1 Like

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

2 Likes


I’m still can’t find a parameter for the location which I could give it values.

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.

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()
1 Like

This might help: https://dictionary.dynamobim.com/#/Revit/Elements/Element/Action/MoveByVector

1 Like

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()
";

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.


This video is showing exactly what I want to do

search for the dynamator package

1 Like

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.

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.

1 Like

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.

1 Like