Get survey point trough API

Get survey point trough API

dante.van.wettum
Advocate Advocate
4,379 Views
4 Replies
Message 1 of 5

Get survey point trough API

dante.van.wettum
Advocate
Advocate

i noticed something weird when i am retrieving the survey point coordinates.

i am using the code below after i have been reading Jeremy's blog ( http://thebuildingcoder.typepad.com/blog/2012/11/survey-and-project-base-point.html )

 

At first this seemed to be right. though i noticed the values changing  when the rotation in the project basepoint changes.

though when i check the survey point properties within revit iself (the blue triangle) it still should be 0,0,0 but the the values trough API are different.

 

why is this happening? am i still retrieving the wrong point somehow, and how to get the right one ?

although its only very little, i dont understand why it isn't 0 anymore as the double you are getting.

(also see attached screenshot N/S value)

 

my code:

 

          FilteredElementCollector locations = new FilteredElementCollector(doc).OfClass(typeof(BasePoint));
            foreach (var locationPoint in locations)
            {
                    BasePoint basePoint = locationPoint as BasePoint;
                    if (basePoint.IsShared== true)
                    {
                        //this is the survey point

                        Location svLoc = basePoint.Location;
                        projectSurvpntX = basePoint.get_Parameter(BuiltInParameter.BASEPOINT_EASTWEST_PARAM).AsDouble();
                        projectSurvpntY = basePoint.get_Parameter(BuiltInParameter.BASEPOINT_NORTHSOUTH_PARAM).AsDouble();
                        projectSurvpntZ = basePoint.get_Parameter(BuiltInParameter.BASEPOINT_ELEVATION_PARAM).AsDouble();
....

 

0 Likes
4,380 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Dante,

 

Please check whether I add some correction in the setout points add-in:

 

http://thebuildingcoder.typepad.com/blog/2012/08/structural-concrete-setout-point-add-in.html#3

 

http://thebuildingcoder.typepad.com/blog/2014/11/concrete-setout-points-for-revit-structure-2015.htm...

 

That reports the correct real-world values for setout points, afaik.

 

Maybe some similar correction is required for the survey point as well.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 5

jeremytammik
Autodesk
Autodesk

Here are some more relevant links to explore:

 

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 5

dante.van.wettum
Advocate
Advocate

thank you for the links.

I will try to wrap my head round it.

 

Something i dont really understand though.

to quote one of the articles "The project base point defines the origin (0,0,0) of the project coordinate system."

So how can revit even touch the values of this point when there is a rotation in the project basepoint. The real 0,0,0 point shouldnt change in my perception.

 

A workaround would be to just get the parameter values as ValueString and parse is to doubles again, but i also try to understand why revit is changing the double 🙂

0 Likes
Message 5 of 5

jeremy_tammik
Alumni
Alumni

I just re-checked your NS image and see that the value you are concerned with is something ...E-11. This means something multiplied by 10^-11, or in other words something divided by 100'000'000'000. That is very small indeed. Such numbers can always occur in digital computers dealing with floating point numbers. Such a small number is absolutely, completely, indistiguishable from exact zero.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes