
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i am new in Revit, so sorry for my question if it stupid.
I trying to get the position created by function "Report shared coordinates". I found the function called GetProjectPosition but it still not working. The function return me LocationPoint values so the X,Y,Z was transformed in 'N/S', 'E/O', 'Elevation' but in the Revit i have the different result.
Here is my code:
XYZ location = ((LocationPoint)element.Location).Point;
this.CoordX = location.X;
this.CoordY = location.Y;
this.CoordZ = location.Z;
this.LocationType = null;
// Get the project location handle
ProjectLocation projectLocation = doc.ActiveProjectLocation;
// Show the information of current project location
ProjectPosition position = projectLocation.GetProjectPosition(location);
if (null == position)
{
throw new Exception("No project position in origin point.");
}
// Format the prompt string to show the message.
String prompt = "Current project location information:\n";
prompt += "\n\t\t" + "Elevation: " + position.Elevation;
prompt += "\n\t\t" + "North to South offset: " + position.NorthSouth;
prompt += "\n\t\t" + "East to West offset: " + position.EastWest;
So i expect to get values exactly the same like in picture below but instead i got LocationPoint values (Elevation:17.48, N/S: -1.4, E/O: 11.20) in the ProjectPosition class.
Here is my shared point created by function "Report shared coordinates", my LocationPoint is exactly the same (center of an Element).
Thank you in advance !
Solved! Go to Solution.