Relocate Project

Hi all, I am trying to set up a new project based on an existing neighboring building’s shared condiments. Steps so far: Link in existing file and acquire coordinates. I then move the survey point to match the link. At this point, I need to relocate the project so the base point and internal origin are aligned to the new building. The only thing I have found is a portable command ewwww.

Do any of you know of a way to mimic the Relocat Project command?

Thank you,
Steven

As far as I know this is not exposed in the API (last checked in 2022).

1 Like

Hello Steven,

Did you try Element.SetParameterValueByName node. It helps you play with some of the parameters such as Elev, N/S or S/W. The only thing you need to do is to unpin the elements otherwise you will get “Parameter is read-only.” error.

That is part of what I am doing but it only moves the SP or BP. I am trying to move the whole project with the BP.

Since it’s a new project it does not matter too much but let’s say the BP needs to be set at 1,000, 1,000, 50. If I were to just set the BP all of the levels and grids that are in the template will remain at 0,0,0 and will need to be adjusted or redone.

Thanks for the thought though. I will report back here if it works but my next attempt is going to be to move the SP while clipped in the inverse direction of the difference between the BP current location and where it’s supposed to be. This should adjust it accordingly. That is my hope at least.

Moving the SP while clipped does not work (You can manually move it but I have not found a way through the API).

I have tried

surveyPoint = DB.BasePoint.GetSurveyPoint(doc)	
spLocation = surveyPoint.Location
#note you need to open a transaction before moving
# attempt 1
ElementTransformUtils.MoveElement(doc, surveyPoint.Id, point)
# attempt 2
spLocation.Move(point)

Both attempt 1 and 2 will move the SP while unclipped.
Neither of them throws a warning when I try to move while clipped and Move even returns True claiming that it was a success.

Edit:
Move does work while clipped. ElementTransformUtils.MoveElement was my first attempt and it moves the SP to the supplied point. Move on the other hand moves bases off of a vector. In my sample project, I moved the SP to 10,10,5 and then tried to move it back to 0,0,0. Since I supplied 0,0,0 and this is a vector without direction (is that possible?) it did not move. To move it back to 0,0,0 I had to supply -10,-10,-5.

Yes, it is possible. In fact it is something which you can use to your advantage - build a zero length vector and you can add a list of additional vectors to it and still have a resulting vector when the list has no items in it. :slight_smile:

This works for Dynamo vectors and Revit XYZ classes.