Esempio n. 1
0
        makeSurface(string strSurfaceName)
        {
            SelectionSet objSSet = EW_Utility1.buildSSet2a(strSurfaceName);

            if (objSSet == null || objSSet.Count == 0)
            {
                return;
            }

            ObjectId[]         ids     = objSSet.GetObjectIds();
            ObjectIdCollection idsBrks = new ObjectIdCollection();

            foreach (ObjectId id in ids)
            {
                idsBrks.Add(id);
            }

            EW_CheckSurfaceStyles.checkSurfaceStyles(strSurfaceName);

            TinSurface objSurface = Surf.getTinSurface(strSurfaceName);

            if (objSurface == null)
            {
                return;
            }
            objSurface.ObjectId.delete();

            objSurface = Surf.addTinSurface(strSurfaceName, out exists);

            objSurface.BreaklinesDefinition.AddStandardBreaklines(idsBrks, 1.0, 0, 0, 0);
            objSurface.BuildOptions.CrossingBreaklinesElevationOption = Autodesk.Civil.CrossingBreaklinesElevationType.UseAverage;

            SelectionSet objSSetLim = EW_Utility1.buildSSetGradingLim();

            if (objSSetLim.Count == 0)
            {
                MessageBox.Show("GRADING LIMIT not found - OUTER BOUNDARY not added.");
                return;
            }


            ObjectId idLWPline = objSSetLim.GetObjectIds()[0];

            Conv.processBndry(idLWPline);

            ObjectId[] id3dPoly = { Conv.poly_Poly3d(idLWPline, 0, "0") };

            objSurface.BoundariesDefinition.AddBoundaries(new ObjectIdCollection(id3dPoly), 1.0, Autodesk.Civil.SurfaceBoundaryType.Outer, true);
            objSurface.Rebuild();
            id3dPoly[0].delete();
        }
Esempio n. 2
0
        public static void makeSurfaceBOT()
        {
            string strSurfaceName = "BOT";

            EW_CheckSurfaceStyles.checkSurfaceStyles(strSurfaceName);

            Surf.removeSurface("BOT");
            TinSurface objSurfaceBOT = Surf.addTinSurface("BOT", out exists);

            ObjectId idCivilPntGrp = CgPnt_Group.checkPntGroup("BOT");

            objSurfaceBOT.PointGroupsDefinition.AddPointGroup(idCivilPntGrp);

            SelectionSet objSSet = EW_Utility1.buildSSet13();

            ObjectId[]         idsBrksArray = objSSet.GetObjectIds();
            ObjectIdCollection idsBrks      = new ObjectIdCollection();

            foreach (ObjectId id in idsBrksArray)
            {
                idsBrks.Add(id);
            }

            objSurfaceBOT.BreaklinesDefinition.AddStandardBreaklines(idsBrks, 1.0, 0, 0, 0);

            ObjectId idLWPline = EW_Utility1.buildSSetGradingLim().GetObjectIds()[0];

            if (idLWPline != ObjectId.Null)
            {
                ObjectIdCollection ids = new ObjectIdCollection();
                ids.Add(idLWPline);
                objSurfaceBOT.BoundariesDefinition.AddBoundaries(ids, 1, Autodesk.Civil.SurfaceBoundaryType.Outer, true);
                objSurfaceBOT.Rebuild();
            }
            else
            {
                MessageBox.Show("GRADING LIMIT not found - OUTER BOUNDARY not added.");
            }
        }
Esempio n. 3
0
        makeRemSurface(double dblDepth)
        {
            EW_CheckSurfaceStyles.checkSurfaceStyles("EXIST");

            Point3d pnt3dMove0 = Point3d.Origin;
            Point3d pnt3dMoveX = new Point3d(0, 0, dblDepth * -1);

            Matrix3d mtx3d = Matrix3d.Displacement(pnt3dMoveX - pnt3dMove0);

            TinSurface objSurfaceExist = Surf.getTinSurface("EXIST");
            ObjectId   idSurface       = objSurfaceExist.copy();

            using (var tr = BaseObjs.startTransactionDb()) {
                TinSurface surface = (TinSurface)tr.GetObject(idSurface, OpenMode.ForWrite);
                surface.Name = "EG-ADJ2";

                Layer.manageLayers("EG-ADJ2-SURFACE");
                surface.Layer = "EG-ADJ2" + "-SURFACE";
                surface.TransformBy(mtx3d);
                surface.Rebuild();
            }
        }