ElementSetLocation by Reference


Hello. Im trying to move an element (wall, window, door…) using the Element get & set Location from its starting point. But after using the Script once the ,GetLocation" Node has a new location from which i am moving the element afterwards.
Is there a possibility to use the NumberSlider from its original point? Lets say if i type in -2 the window goes to the left and if i type +3 the window will move to the right from its origin before?

Hi,

So are you saying that if you move a window +3, then close and open the graph and move -2 , it will remember where it started and move the window back -5?

If so, then you would have to store the element’s original location in a (text?) file and translate between the updated value and the original to generate the new location.

I might be misunderstanding completely :slight_smile:

I hope that helps,

Mark

1 Like

Hello,
It seems to me that the node translate only duplicates (But I could be wrong, I’m still a beginner)
otherwise here is a possibility (only valid from the dynamo browser)

cordially
christian.stan

1 Like

Hey,
first of all thanks for your fast replies.

@Mark: Yes you got it right. Can you give me a short tip on how to execute this?

@Christian: Youre right the translation node doesnt do the job but in my script it was necessary, the GetLocation & SetLocation brings the result. I like your script it seems to save the original spot of the window and move it from there. But there is one issue with it. When playing the script it does not move the window in my revit model but only the points in dynamo backround as you see in the image below.
image
Also i get a warning ,attempt to modify the model outside of transaction". Do you know how i could use your script to really move the window in my revit model?

Hello, here is the script made from the Dynamo Player
Watch video

Cordially
christian.stan

Hey,
thanks for the effort! I found an slimmer solution to my problem in the dynamo dictionary:


Although it does not keep the original position of the window, just like in your case. But i will keep going by that.

1 Like