Beispiel #1
0
        private static void processWater(string nameLayer, ObjectId idPolyGuideline, BlockTableRecord ms, ref List <POI> varPOI, out ObjectId idAlign)
        {
            string    nameAlign = Align.getAlignName(nameLayer);
            Alignment align     = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true);

            fStake.ACTIVEALIGN = align;
            idAlign            = align.ObjectId;
            fStake.objectID    = idAlign;

            Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI);

            Stake_GetNestedObjects.getNestedObjects(idAlign, ref varPOI, "CNTL");

            Stake_GetCardinals.getCrossingAligns(idAlign, ref varPOI);

            varPOI         = Stake_ModifyStaking.modifyStaking(varPOI);
            fStake.POI_ORG = varPOI;

            Stake_GetCardinals.checkBegAndEndStations(idAlign, ref varPOI);

            Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", false);

            Stake_GetAnglePoints.getAnglePoints(idAlign, ref varPOI);//IDENTIFY ANGLE POINTS - CHECK IF CLOSED

            var sortSta = from s in varPOI
                          orderby s.Station ascending
                          select s;

            List <POI> poiTmp = new List <POI>();

            foreach (var s in sortSta)
            {
                poiTmp.Add(s);
            }
            varPOI = poiTmp;

            Stake_DuplicateStations.resolveDuplicateStations(ref varPOI);

            Stake_GetSurfaceElev.getSurfaceElevations(idAlign, ref varPOI);//ALL ELEVATIONS COME FROM SURFACE

            Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", true);

            if (varPOI[0].isClosed)
            {
                Stake_GetAnglePoints.addEndElev(idAlign, ref varPOI, "CPNT");
            }

            Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", true, "STAKE");
            fStake.POI_CALC = varPOI;
        }
Beispiel #2
0
        processCurb(string nameLayer, ObjectId idPolyGuideline, BlockTableRecord ms, string nameXRef, ref List <POI> varPOI, out ObjectId idAlign)
        {
            string    nameAlign = Align.getAlignName(nameLayer);
            Alignment align     = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true);

            fStake.ACTIVEALIGN = align;
            idAlign            = align.ObjectId;
            fStake.objectID    = idAlign;

            Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI);

            Stake_GetNestedObjects.getNestedPoints(idAlign, ref varPOI, ms, nameXRef);

            fStake.POI_ORG = varPOI;

            Stake_GetCardinals.getCardinals_Vertical(idAlign, ref varPOI);

            Stake_AddProfile.makeProfile(idAlign, varPOI, "CURB", "ByLayout", false); //VERTICAL CONTROL IS SET FROM POINTS

            Stake_GetAnglePoints.getAnglePoints(idAlign, ref varPOI);                 //IDENTIFY ANGLE POINTS - CHECK IF CLOSED

            Stake_GetCardinals.checkBegAndEndStations(idAlign, ref varPOI);

            if (varPOI[0].isClosed)
            {
                Stake_GetAnglePoints.addEndElev(idAlign, ref varPOI, "FLOWLINE");
            }

            Stake_GetBC_EC.getBC_EC(idAlign, ref varPOI);

            Debug.Print("BEGIN POI AFTER getBC_EC");

            for (int i = 0; i < varPOI.Count; i++)
            {
                Debug.Print(i + " " + varPOI[i].Station + " " + varPOI[i].Elevation + " " + varPOI[i].Desc0 + "   " + varPOI[i].DescX);
            }

            Debug.Print("END POI AFTER getBC_EC");

            Stake_DuplicateStations.resolveDuplicateStations(ref varPOI);

            Stake_AddProfile.makeProfile(idAlign, varPOI, "CURB", "ByLayout", true);

            Stake_UpdateProfile.updateProfile(idAlign, fStake.POI_ORG, "FLOWLINE", true, "ORG");

            Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", false, "STAKE");
        }
Beispiel #3
0
        processAlign(string nameLayer, ObjectId idPolyGuideline)
        {
            BlockTableRecord ms       = null;
            List <POI>       varPOI   = new List <POI>();
            ObjectId         idTable  = ObjectId.Null;
            ObjectId         idAlign  = ObjectId.Null;
            string           nameXRef = "";
            ResultBuffer     rb;

            TypedValue[] tvs;

            switch (fStake.ClassObj)
            {
            case "BLDG":

                Stake_GetNestedObjects.copyGRID((fStake.XRefDbModelSpace));     //XrefDbModelSpace is source of grid selected
                idPolyGuideline.delete();
                fStake.Hide();
                Application.ShowModelessDialog(Application.MainWindow.Handle, fGrid, false);

                break;

            case "CURB":
                rb = xRef.getXRefsContainingTargetDwgName("GCAL");
                if (rb == null)
                {
                    Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("GCAL drawing not attached");
                    return;
                }

                tvs      = rb.AsArray();
                nameXRef = tvs[0].Value.ToString();
                ms       = xRef.getXRefBlockTableRecordMS(nameXRef);

                processCurb(nameLayer, idPolyGuideline, ms, nameXRef, ref varPOI, out idAlign);

                idTable = Stake_Table.makeTable(idAlign, varPOI);
                Stake_Table.addTableData(idTable, varPOI);

                break;

            case "FL":
                rb = xRef.getXRefsContainingTargetDwgName("GCAL");
                if (rb == null)
                {
                    Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("GCAL drawing not attached");
                    return;
                }

                tvs      = rb.AsArray();
                nameXRef = tvs[0].Value.ToString();
                ms       = xRef.getXRefBlockTableRecordMS(nameXRef);

                processFlowline(nameLayer, idPolyGuideline, ms, nameXRef, ref varPOI, out idAlign);

                //        fStake.POI = varPOI

                idTable = Stake_Table.makeTable(idAlign, varPOI);
                Stake_Table.addTableData(idTable, varPOI);

                break;

            case "SEWER":
                rb = xRef.getXRefsContainingTargetDwgName("UTIL");
                if (rb == null)
                {
                    Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("UTIL drawing not attached");
                    return;
                }

                tvs      = rb.AsArray();
                nameXRef = tvs[0].Value.ToString();
                ms       = xRef.getXRefBlockTableRecordMS(nameXRef);

                processSewer(nameLayer, idPolyGuideline, ms, nameXRef, ref varPOI, out idAlign);

                //    Call makeProfileINVERT(objAlign, varPOI)

                //        fStake.POI = varPOI

                idTable = Stake_Table.makeTable(idAlign, varPOI);
                Stake_Table.addTableData(idTable, varPOI);

                break;

            case "WTR":

                processWater(nameLayer, idPolyGuideline, ms, ref varPOI, out idAlign);

                idTable = Stake_Table.makeTable(idAlign, varPOI);
                Stake_Table.addTableData(idTable, varPOI);

                break;
            }

            fStake.POI_CALC = varPOI;
            //#############################################################
        }
Beispiel #4
0
        Process(string varObjName = "")
        {
            Object xRefPath = null;
            Entity obj      = xRef.getEntity("\nSelect feature to stake: ", out escape, out xRefPath, out ps);

            fStake.XRefDbModelSpace = xRef.getXRefBlockTableRecordMS(xRefPath.ToString());
            ObjectId idAlign = ObjectId.Null;

            if (escape)
            {
                return;
            }

            ObjectId idPolyGuideline = ObjectId.Null;

            string nameLayer = "";

            switch (obj.GetType().Name)
            {
            case "Arc":
            case "Line":
            case "Polyline":
            case "Polyline2d":
            case "Polyline3d":

                idPolyGuideline = Stake_GetGuidelines.getGuidelines(obj);

                if (varObjName == "")
                {
                    nameLayer = obj.Layer;
                    int intPos = nameLayer.IndexOf("|");
                    nameLayer = nameLayer.Substring(intPos + 1);

                    fStake.NameStakeObject = nameLayer;
                }
                else
                {
                    nameLayer              = "SIDEWALK";
                    fStake.ClassObj        = "SIDEWALK";
                    fStake.NameStakeObject = "SIDEWALK";
                }

                if (nameLayer.Contains("CURB"))
                {
                    if (!testClass("CURB", nameLayer))
                    {
                        return;
                    }
                }
                else if (nameLayer.Contains("FL"))
                {
                    if (!testClass("FL", nameLayer))
                    {
                        return;
                    }
                }
                else if (nameLayer.Contains("FTG") || nameLayer.Contains("FOOTING"))
                {
                    if (!testClass("FTG", nameLayer))
                    {
                        return;
                    }
                }
                else if (nameLayer.Contains("SEWER"))
                {
                    if (!testClass("SEWER", nameLayer))
                    {
                        return;
                    }
                }
                else if (nameLayer.Contains("SD"))
                {
                    if (!testClass("SD", nameLayer))
                    {
                        return;
                    }
                }
                else if (nameLayer.Contains("WALL"))
                {
                    if (!testClass("WALL", nameLayer))
                    {
                        return;
                    }
                }
                else if (nameLayer.Contains("WATER") || nameLayer.Contains("WAT") || nameLayer.Contains("WTR") || nameLayer.Contains("FIRE") ||
                         nameLayer.Contains("VERIZON") || nameLayer.Contains("ELEC") || nameLayer.Contains("CABLE") ||
                         nameLayer.Contains("PHONE") || nameLayer.Contains("TELE"))
                {
                    if (!testClass("WTR", nameLayer))
                    {
                        return;
                    }
                }

                processAlign(nameLayer, idPolyGuideline);

                break;

            case "DbAlignment":

                List <POI> varPOI   = new List <POI>();
                Alignment  objAlign = (Alignment)obj;
                idAlign = objAlign.ObjectId;

                fStake.ACTIVEALIGN = objAlign;
                nameLayer          = string.Format("STAKE-{0}", objAlign.Name);
                Layer.manageLayers(nameLayer);
                idAlign.changeProp(nameLayer: nameLayer);

                fStake.HandleAlign = objAlign.Handle;
                fStake.objectID    = idAlign;

                fStake.NameStakeObject = objAlign.Name;

                if (objAlign.Name.Contains("WALL"))
                {
                    fStake.ClassObj = "WALL";
                }
                else
                {
                    fStake.ClassObj = "ALIGN";
                }

                switch (fStake.ClassObj)
                {
                case "ALIGN":

                    Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI);

                    Stake_GetNestedObjects.getNestedPoints(idAlign, ref varPOI, fStake.XRefDbModelSpace, Path.GetFileName(xRefPath.ToString()));

                    Stake_GetCardinals.getCardinals_Vertical(idAlign, ref varPOI);

                    //        Call getNestedObjects(objAlign, varPOI)

                    Stake_GetCardinals.getCrossingAligns(idAlign, ref varPOI);

                    Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", false);

                    Stake_GetBC_EC.getBC_EC(idAlign, ref varPOI);

                    Stake_DuplicateStations.resolveDuplicateStations(ref varPOI);

                    Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", false, "STAKE");
                    Stake_UpdateProfile.updateProfile(idAlign, (fStake.POI_PNTs), "STAKE", true, "PNTS");

                    ResultBuffer rb = xRef.getXRefsContainingTargetDwgName("GCAL");
                    if (rb == null)
                    {
                        Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("GCAL drawing not attached");
                        return;
                    }

                    TypedValue[]     tvs      = rb.AsArray();
                    string           nameXRef = tvs[0].Value.ToString();
                    BlockTableRecord ms       = xRef.getXRefBlockTableRecordMS(nameXRef);

                    //        If getNestedPoints(objAlign, varPOI, objXRefDbModelSpace, "GCAL") = False Then
                    //          Exit Sub
                    //        End If

                    Debug.Print("After getNestedPoints");
                    for (int i = 0; i < varPOI.Count; i++)
                    {
                        Debug.Print(varPOI[i].Station + "  " + varPOI[i].Desc0);
                    }

                    //    Call makeProfileINVERT(objAlign, varPOI)

                    fStake.POI_CALC = varPOI;
                    //#############################################################

                    ObjectId idTable = Stake_Table.makeTable(idAlign, varPOI);
                    Stake_Table.addTableData(idTable, varPOI);

                    break;

                case "WALL":

                    Stake_Wall.processWall(idAlign);

                    break;
                }
                break;

            default:
                break;
            }

            if (fStake.ClassObj != "BLDG")
            {
                TypedValue[] tvs = new TypedValue[2] {
                    new TypedValue(1001, "CLASS"), new TypedValue(1000, fStake.ClassObj)
                };
                idAlign.setXData(tvs, "CLASS");
            }
        }
Beispiel #5
0
        processSewer(string nameLayer, ObjectId idPolyGuideline, BlockTableRecord ms, string nameXRef, ref List <POI> varPOI, out ObjectId idAlign)
        {
            List <Point3d> pnts3d    = idPolyGuideline.getCoordinates3dList();
            Alignment      align     = null;
            string         nameAlign = "";

            idAlign = ObjectId.Null;

            if (pnts3d.Count == 1)
            {
                DialogResult varResponse = System.Windows.Forms.MessageBox.Show("Single segment selected!!\n\n" + "Proceed with single segment?\n", "SINGLE SEGMENT SELECTED", MessageBoxButtons.YesNo);

                switch (varResponse)
                {
                case DialogResult.Yes:
                    nameAlign          = Align.getAlignName(nameLayer);
                    align              = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true);
                    fStake.ACTIVEALIGN = align;
                    idAlign            = align.ObjectId;
                    fStake.objectID    = idAlign;
                    break;

                case DialogResult.No:
                    varResponse = System.Windows.Forms.MessageBox.Show("Create Alignment?\n", "CREATE ALIGNMENT", MessageBoxButtons.YesNo);

                    switch (varResponse)
                    {
                    case DialogResult.Yes:
                        Stake_Algn.createNewAlign(nameLayer);
                        idPolyGuideline.delete();
                        break;

                    case DialogResult.No:
                        idPolyGuideline.delete();
                        break;
                    }
                    break;
                }
            }
            else
            {
                nameAlign          = Align.getAlignName(nameLayer);
                align              = Align.addAlignmentFromPoly(nameAlign, nameLayer, idPolyGuideline, "Standard", "Standard", true);
                fStake.ACTIVEALIGN = align;
                idAlign            = align.ObjectId;
                fStake.objectID    = idAlign;
            }

            fStake.HandleAlign     = idAlign.getHandle();
            fStake.NameStakeObject = nameAlign;

            Stake_GetCardinals.getCardinals_Horizontal(idAlign, ref varPOI);

            Stake_GetNestedObjects.getNestedPoints(idAlign, ref varPOI, ms, nameXRef);

            Stake_GetCardinals.getCrossingAligns(idAlign, ref varPOI);

            fStake.POI_ORG = varPOI;

            Stake_GetCardinals.getCardinals_Vertical(idAlign, ref varPOI);

            Stake_AddProfile.makeProfile(idAlign, varPOI, "STAKE", "ByLayout", false);

            Stake_GetBC_EC.getBC_EC(idAlign, ref varPOI);

            Stake_DuplicateStations.resolveDuplicateStations(ref varPOI);

            Stake_UpdateProfile.updateProfile(idAlign, varPOI, "STAKE", false, "STAKE");

            Stake_UpdateProfile.updateProfile(idAlign, fStake.POI_PNTs, "STAKE", true, "PNTS");
        }