Example #1
0
        public void GetSurfaceData(string surfaceName)
        {
            ObjectIdCollection SurfaceIds = CivilDoc.GetSurfaceIds();

            foreach (ObjectId surfaceId in SurfaceIds)
            {
                TinSurface oSurface = surfaceId.GetObject(OpenMode.ForRead) as TinSurface;
                if (oSurface.Name == surfaceName)
                {
                    //Get surface parameters at the insert point
                    ZOnSurface = (float)oSurface.FindElevationAtXY(X0, Y0);
                    float direction = (float)oSurface.FindDirectionAtXY(X0, Y0);
                    float slope     = (float)oSurface.FindSlopeAtXY(X0, Y0);

                    //Get point coordinates for the second point of the vector
                    GetPointCoordinatesByRad(direction);
                    Z1 = (float)oSurface.FindElevationAtXY(X1, Y1);

                    Slope = (float)Math.Atan(slope);
                }
            }
        }