Script for moving objects using coordinates


I am student, and I have gotten hold of a script that reads the X, Y and Z coordinates of all the objects in my Revit model, and then writes them to three different instance parameters: “X”, “Y”, and “Z”.

What I would like to know, if is there any possibillity to be able to make a script that lets me edit the coordinates while in the model, while at the same time my object will move where I set it to? I do have the coordinates there allready, and it is possible to edit the text, however nothing happens when I do, as it is only text.

Thanks in advance, and please feel free to correct me if I am doing anything wrong with this post, as it is my first time posting on this forum.


The image above shows the result on a lighting fixture after running the script. The text is editable (understandable), but I want to be able to controll it through those parameteres.

If I edit the text, and then re-run the script, the coordinates reset to the objects position.

It depends what type of family it is. A light fixture as shown in your screenshot would usually be ceiling hosted, so this complicates it.

You could try Element.SetLocation from the Spring nodes package. It would essentially be the opposite of your current graph
i.e build a poimt from your 3 parameters, then feed that into SetLocation


Thank you Andrew!

It worked!