Move Survey point in order to let Project Base Point and model in georreferenced place

Hi, dear Dynamo mates!

I’m working on a script that should link a provided 3D dwg with a terrain topography, that should acquire its georreferenced coordinates and that should move them in order to make the model situation match with a correct geolocation in the ground provided as input.

My idea, os the strategy I’m following is:

  1. Link dwg with centre to centre placement
  2. Acquire coordinates
  3. Move survey point, once adopted acquired coordinates, in the same direction that desired building placement point (expressed in UTM ETRS89 coordinates, as the dwg) has respect to internal origin or Project Base Point (expressed also in UTM acquired coordinates). Like using the vector of the desired position (point A) to the previous PBP position (point B) to get the translation vector

Ok, i can do it manually in Revit environment. If I move survey point (triangle with active clip) in the direction I want, the linked dwg and the hole acquired coordinate system come dragged with it and let the building in correct georreferenced place. I think is like move terrain to the building inspite of put building on terrain.

Model initial workspace is as set by default, with PBP, SP and internal origin coincidents at 0,0,0. And in Revit I only need to move survey point

The problem appears when I try to translate this actions into Dynamo workspace. I’ve linked dwg and acquired its coordinates succesfully but I still can’t move Survey point letting the already created model and Project Base Point in desiderated position.

In this link Unique Download Link | WeTransfer you can download basic .rvt’s with a wall that represents the building, the dwg I use as topography and the script I’m developing.

I wanted to put the building in coordinate x=4696929.0835 y=516288.3179 as marked on the dwg. To sum up, this is result I would wanted to reach:

I’ve was reading many literature about Revit coordinates and their control with Dynamo but i still can’t understand very well how it works on dynamo

Can you give me a piece of advice on how to proceed?

Thank you!,
Diego

You’re not going to be able to do this in an automatic way. You can rotate the project position angle and adjust the survey point values to align, however due to the way the DWG is authored it will only come in centre to centre and then you can’t get a geolocated position on it to know the amount to shift See Below

Hei, Mike
script09_TOPOGRAFÍA v17.dyn (82.3 KB)

This days i was working on it and finally i think i’ve found a solution
The problem was the reference coordinates in the input so as to create the translate vector

This node made the solution:

I posted the script if you want to check
Thank you also for commenting!

Diego

@diego.mata.pose, firstly apologies for giving incorrect advice - you can acquire the coordinates of the DWG. And if you know the origin point and angle of North, update the project position to suit
Here is a python version

import clr
from System import Enum

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

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

units = doc.GetUnits().GetFormatOptions(SpecTypeId.Length).GetUnitTypeId()
origin = XYZ.Zero

# Inputs
path = IN[0]
view = UnwrapElement(IN[1])
ref = [UnitUtils.ConvertToInternalUnits(n, units) for n in IN[2]]
proj_N = UnitUtils.ConvertToInternalUnits(IN[3], UnitTypeId.Degrees)

# Set up new Project Location
project_loc = doc.ActiveProjectLocation
project_pos = ProjectPosition(*ref, proj_N)

# Import, aquire coordiantes and adjust project location
TransactionManager.Instance.EnsureInTransaction(doc)

options = DWGImportOptions()
import_instance, link_load_result = ImportInstance.Create(
    doc, view, path, options, LinkLoadResult()
)

# Check if new link for changing shared location
if link_load_result.LoadResult == LinkLoadResultType.LinkLoaded:
    doc.AcquireCoordinates(import_instance.Id)

    project_loc.SetProjectPosition(origin, project_pos)

    # Rotate view to true north
    if view.ViewType == ViewType.FloorPlan:
        view.get_Parameter(BuiltInParameter.PLAN_VIEW_NORTH).Set(1)

    OUT = import_instance

else:
    OUT = Enum.GetName(LinkLoadResultType, link_load_result.LoadResult)

TransactionManager.Instance.TransactionTaskDone()

1 Like