コード例 #1
0
ファイル: EW_MakeSurfaceVol.cs プロジェクト: 15831944/EM
        makeVolSurface(string strNameBASE, string strNameCOMP, bool boolShowMessage)
        {
            string        nameSurface  = string.Format("VOL_{0}_{1}", strNameBASE, strNameCOMP);
            List <string> nameSurfaces = Surf.getSurfaces();

            for (int i = 0; i < nameSurfaces.Count; i++)
            {
                if (nameSurfaces[i] == nameSurface)
                {
                    Surf.removeSurface(nameSurfaces[i]);
                }
            }

            TinSurface objSurfaceBASE = Surf.getTinSurface(strNameBASE);
            TinSurface objSurfaceCOMP = Surf.getTinSurface(strNameCOMP);

            int lngVolCut  = 0;
            int lngVolFill = 0;

            ObjectId idSurfFill = TinVolumeSurface.Create(nameSurface, objSurfaceBASE.ObjectId, objSurfaceCOMP.ObjectId);

            SelectionSet objSSetLim = EW_Utility1.buildSSetGradingLim();

            ObjectId[]       ids            = objSSetLim.GetObjectIds();
            TinVolumeSurface objSurfaceFILL = null;

            if (ids != null && ids.Length > 0)
            {
                ObjectId idPoly = ids[0];
                idPoly.checkIfClosed();

                ObjectId   idPoly3d = Conv.poly_Poly3d(idPoly, 0, "0");
                ObjectId[] idBndrys = { idPoly3d };
                objSurfaceFILL = (TinVolumeSurface)idSurfFill.getEnt();
                objSurfaceFILL.BoundariesDefinition.AddBoundaries(new ObjectIdCollection(idBndrys), 1.0, Autodesk.Civil.SurfaceBoundaryType.Outer, true);
                objSurfaceFILL.Rebuild();
                idPoly3d.delete();
            }
            else
            {
                MessageBox.Show("GRADING LIMIT not found - OUTER BOUNDARY not added.");
            }

            lngVolCut  = (int)objSurfaceFILL.GetVolumeProperties().UnadjustedCutVolume / 27;
            lngVolFill = (int)objSurfaceFILL.GetVolumeProperties().UnadjustedFillVolume / 27;

            if (boolShowMessage == true)
            {
                string mess = string.Format("Cut: {0} CY     Fill: {1} CY", lngVolCut, lngVolFill);
                MessageBox.Show(mess);
            }

            EW_Main.viewResults("VOL", false);
        }
コード例 #2
0
ファイル: EW_MakeSurfaceVol.cs プロジェクト: 15831944/EM
        updateVolSurface(string strNameBASE, string strNameCOMP)
        {
            string        nameSurface  = string.Format("VOL_{0}_{1}", strNameBASE, strNameCOMP);
            List <string> nameSurfaces = Surf.getSurfaces();

            for (int i = 0; i < nameSurfaces.Count; i++)
            {
                if (nameSurfaces[i] == nameSurface)
                {
                    Surf.removeSurface(nameSurfaces[i]);
                }
            }

            TinSurface objSurfaceBASE = Surf.getTinSurface(strNameBASE);
            TinSurface objSurfaceCOMP = Surf.getTinSurface(strNameCOMP);

            TinVolumeSurface.Create(nameSurface, objSurfaceBASE.ObjectId, objSurfaceCOMP.ObjectId);
        }