Pile Coordinates With True North

Hi everyone,

I have tried all the topics in this forum related to geometry location and I couldn’t find the solution… I can get the project base point coordinates and the true north rotation value, and the distance from the pile location from the project base point, but it’s not a simple sum becaus it is differente vectors, so i need to discover how to sum this values to have the true coordinates value.
Can someone help me? Here is the image of the dynamo scrip so far…

If this is about survey CS and rotation something like that?


** missed out the z-direction node

But it´s easier to use a total transform node:

image

Or this code:

import clr
import math

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory, BuiltInParameter, XYZ

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Autodesk.DesignScript.Geometry import Vector, CoordinateSystem

doc = DocumentManager.Instance.CurrentDBDocument

pbp = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_ProjectBasePoint).FirstElement()

pbpEW = pbp.get_Parameter(BuiltInParameter.BASEPOINT_EASTWEST_PARAM).AsDouble()
pbpNS = pbp.get_Parameter(BuiltInParameter.BASEPOINT_NORTHSOUTH_PARAM).AsDouble()
pbpElev = pbp.get_Parameter(BuiltInParameter.BASEPOINT_ELEVATION_PARAM).AsDouble()

# Angle from the parameter is in radians, converting it to degrees
pbpAngle = pbp.get_Parameter(BuiltInParameter.BASEPOINT_ANGLETON_PARAM).AsDouble()
pbpAngle = math.degrees(pbpAngle)

# Creating Dynamo Point
pbpPoint = (XYZ(pbpEW, pbpNS, pbpElev)).ToPoint()

# Creating Dynamo CoordinateSystem with rotation
xAxis = Vector.ByCoordinates(1, 0, 0)
yAxis = Vector.ByCoordinates(0, 1, 0)
origin = pbpPoint

# Rotating the vectors
xAxis = xAxis.Rotate(Vector.ByCoordinates(0,0,1), -pbpAngle)
yAxis = yAxis.Rotate(Vector.ByCoordinates(0,0,1), -pbpAngle)

# Creating the CoordinateSystem
coordinate_system = CoordinateSystem.ByOriginVectors(origin, xAxis, yAxis)

OUT = coordinate_system

The Revit internal and project coordinate systems are aligned so I’m pretty sure you do not need to rotate. Survey coordinates have rotation and I haven’t been able to work that out see next post


Translate to survey coordinates

Hi @lucas.a not sure if it could help, but genius loci have some node as well

2 Likes