Get BoundingBox in Survey Coordinate System

Get BoundingBox in Survey Coordinate System

Anonymous
Not applicable
887 Views
4 Replies
Message 1 of 5

Get BoundingBox in Survey Coordinate System

Anonymous
Not applicable

Hi

I am trying to get the bounding box corners of a window using the bounding box min and max of the window family instance. I have succeeded in getting the corners. Now I want to insert a face with those corners in revit. When I tried inserting, the face was inserted with some offset and rotation. I found that is because the face is inserted in Project based coordinates(base point). But I want them in survey point coordinates. 

 

How can i convert from base point to survey point?

 

I have tried this, but didn't work.

ProjectLocation pl = doc.ActiveProjectLocation;
Transform ttr = pl.GetTotalTransform().Inverse;
LocationPoint loc = element.Location as LocationPoint;
if (loc != null)
{
    XYZ point = ttr.OfPoint(loc.Point);
}
0 Likes
888 Views
4 Replies
Replies (4)
Message 2 of 5

dante.van.wettum
Advocate
Advocate

If i recall correct you should retreive the projectposition.

 

ProjectLocation prLoc = doc.ActiveProjectLocation;

ProjectPosition pos = prLoc.get_ProjectPosition(XYZ.Zero);

 


From 2018 API and up

ProjectPosition pos = prLoc.GetProjectPosition(XYZ.Zero);

0 Likes
Message 3 of 5

Anonymous
Not applicable

I have also tried that. But it didn't make any difference.

0 Likes
Message 4 of 5

dante.van.wettum
Advocate
Advocate

yes but once you retrieved your project basepoint coordinates, you can just add or subtract them with the position of your element (do note, you will need some more formulas if your are using a rotation to true north).

 

ProjectPosition.EastWest  //  ProjectPosition.NorthSouth // ProjectPosition.Elevation  will give you the XYZ of your model 0-basepoint.

 

0 Likes
Message 5 of 5

Anonymous
Not applicable

I am always getting the Project position coordinates as 0. (Elevation, EastWest and NorthSouth)

0 Likes