Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have a quick question about retrieving the Project Base Point Coordinates in Meters.
Here's what I'm currently doing:
foreach (Autodesk.Revit.DB.ProjectLocation location in document.ProjectLocations)
{
Autodesk.Revit.DB.ProjectPosition projectPosition = location.GetProjectPosition(Autodesk.Revit.DB.XYZ.Zero);
double ns = Autodesk.Revit.DB.UnitUtils.ConvertFromInternalUnits(projectPosition.NorthSouth, Autodesk.Revit.DB.UnitTypeId.Meters);
double ew = Autodesk.Revit.DB.UnitUtils.ConvertFromInternalUnits(projectPosition.EastWest, Autodesk.Revit.DB.UnitTypeId.Meters);
double el = Autodesk.Revit.DB.UnitUtils.ConvertFromInternalUnits(projectPosition.Elevation, Autodesk.Revit.DB.UnitTypeId.Meters);
System.Diagnostics.Debug.WriteLine(ns.ToString(System.Globalization.CultureInfo.InvariantCulture));
System.Diagnostics.Debug.WriteLine(ew.ToString(System.Globalization.CultureInfo.InvariantCulture));
System.Diagnostics.Debug.WriteLine(el.ToString(System.Globalization.CultureInfo.InvariantCulture));
}
And this is what it prints:
5805155.0267429
3526500.91565812
0
As you can see, the coordinates are off - in the case of N/S, by more than 5 meters.
Can anyone tell me what I am doing wrong?
This is Revit 2022 btw, but version doesn't seem to make a difference (other than the fact that in 2020 and earlier the unit type was passed differently).
Thanks and regards
Aminius
Solved! Go to Solution.