Beispiel #1
0
        BC1(string nameCmd)
        {
            List <double> userInput  = null;
            Polyline3d    poly3dFL   = null;
            ObjectId      idPoly3dFL = ObjectId.Null;

            int side;

            Point3d pnt3dBEG = Pub.pnt3dO;
            Point3d pnt3dEND = Pub.pnt3dO;
            Point3d pnt3dX   = Pub.pnt3dO;

            List <ObjectId> idsCgPnt = new List <ObjectId>();
            ObjectId        idPoly   = ObjectId.Null;
            bool            escape   = false;

            try
            {
                userInput = cmdBC.getUserInput(nameCmd);
                if (userInput == null)
                {
                    return;
                }

                BaseObjs.acadActivate();

                if (Grading_Palette.gPalette.pGrading.optBRKLINE.IsChecked == true)
                {
                    Point3d pnt3dPick;
                    Entity  ent = Select.selectEntity(typeof(Polyline3d), "Select Brkline:", "Brkline selection failed.", out pnt3dPick);
                    poly3dFL   = (Polyline3d)ent;                                   //this 3dPoly is from points and is linked to the points with "lnkBrks" !!!!!!!!!!!!!!!!!!!!!!!!!!
                    idPoly3dFL = poly3dFL.ObjectId;
                    ResultBuffer rb = idPoly3dFL.getXData(null);
                    if (rb == null)
                    {
                        return;
                    }
                    TypedValue[]        tvsAll = rb.AsArray();
                    List <string>       nameApps;
                    List <TypedValue[]> tvsLst = tvsAll.parseXData(out nameApps);

                    if (nameApps.Contains(apps.lnkBrks) || nameApps.Contains(apps.lnkBrks2))
                    {
                        foreach (TypedValue[] tvs in tvsLst)
                        {
                            if (tvs[0].Value.ToString() == apps.lnkBrks)
                            {
                                idPoly3dFL.clearXData(apps.lnkBrks);
                                tvs.SetValue(new TypedValue(1001, apps.lnkBrks2), 0);     //link end points to FL upgraded from brkline
                                idPoly3dFL.setXData(tvs, apps.lnkBrks2);
                            }
                            else if (tvs[0].Value.ToString() == apps.lnkBrks2)
                            {
                                idPoly3dFL.clearXData(apps.lnkBrks3);                     //clear old link data if exists - endpoints should be same
                            }
                        }
                    }
                }
                else if (Grading_Palette.gPalette.pGrading.optPNTS.IsChecked == true)
                {
                    try
                    {
                        string prompt1 = "\nSelect first point (Esc to quit): ";
                        string prompt2 = "\nSelect next point (Enter to exit/Esc to quit: ";

                        idsCgPnt = getPoints(prompt1, prompt2);

                        idPoly3dFL = BrkLine.makeBreakline(apps.lnkBrks2, "BC", out idPoly, idsCgPnt);         //this 3dPoly is from points and is linked to the points with "lnkBrks2"    OK.
                    }
                    catch (System.Exception ex)
                    {
                        BaseObjs.writeDebug(ex.Message + " cmdBC1.cs: line: 79");
                    }
                }

                try
                {
                    using (Transaction tr = BaseObjs.startTransactionDb())
                    {
                        poly3dFL = (Polyline3d)tr.GetObject(idPoly3dFL, OpenMode.ForRead);

                        pnt3dBEG = idsCgPnt[0].getCogoPntCoordinates();
                        pnt3dEND = idsCgPnt[1].getCogoPntCoordinates();

                        PromptStatus ps;
                        string       prompt = "\nPick point Back of Curb adjacent to first segment";
                        pnt3dX = UserInput.getPoint(prompt, pnt3dBEG, out escape, out ps, osMode: 0);
                        if (pnt3dX == Pub.pnt3dO || escape)
                        {
                            return;
                        }
                        if (pnt3dX.isRightSide(pnt3dBEG, pnt3dEND))
                        {
                            side = 1;
                        }
                        else
                        {
                            side = -1;
                        }

                        double offH1 = 0.5 * side;
                        double offV1 = userInput[0] + 0.0208;
                        double offH2 = userInput[1] * side;
                        double offV2 = userInput[2] * userInput[1];

                        List <Handle> handles = new List <Handle>();


                        ObjectId idPoly3dTC = buildCurbFeature(offH1, offV1, idPoly3dFL, idPoly3dFL, false, ref handles, side);        // collect handles from TC, BB, CgPnt, GT
                        Grading_Dict.addBrksToPntXDict(idPoly3dFL, idPoly3dTC, offH1, offV1, 0.0, -1.0);

                        ObjectId idPoly3dBB = buildCurbFeature(offH2, offV2, idPoly3dFL, idPoly3dTC, true, ref handles, side);
                        Grading_Dict.addBrksToPntXDict(idPoly3dFL, idPoly3dBB, offH1 + offH2, offV1 + offV2, 0.0, -1.0);

                        ObjectId idPolyBB = idPoly3dBB.addPoly("GB");
                        handles.Add(idPolyBB.getHandle());

                        if (nameCmd == "cmdBG")
                        {
                            double offH3 = userInput[3] * side * -1;
                            double offV3 = userInput[4];

                            ObjectId idPoly3dLP = buildCurbFeature(offH3, offV3, idPoly3dFL, idPoly3dFL, true, ref handles, side);
                            Grading_Dict.addBrksToPntXDict(poly3dFL.ObjectId, idPoly3dLP, offH3, offV3, 0.0, -1.0);

                            ObjectId idPolyGT = idPoly3dLP.addPoly("Gutter");
                            handles.Add(idPolyGT.getHandle());
                        }

                        idPoly3dFL.setXData(handles, apps.lnkBrks3);

                        tr.Commit();
                    }
                }
                catch (System.Exception ex)
                {
                    BaseObjs.writeDebug(ex.Message + " cmdBC1.cs: line: 140");
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " cmdBC1.cs: line: 145");
            }
        }
Beispiel #2
0
        BC(string nameCmd)
        {
            List <double> userInput  = null;
            Polyline3d    poly3dFL   = null;
            ObjectId      idPoly3dFL = ObjectId.Null;

            Point3d pnt3dBEG = Pub.pnt3dO;
            Point3d pnt3dEND = Pub.pnt3dO;
            Point3d pnt3dX   = Pub.pnt3dO;

            int side;

            bool escape = false;

            try
            {
                userInput = getUserInput(nameCmd);
                if (userInput == null)
                {
                    return;
                }

                BaseObjs.acadActivate();

                int snapMode = SnapMode.getOSnap();
                SnapMode.setOSnap(8);

                if (Grading_Palette.gPalette.pGrading.optBRKLINE.IsChecked == true)
                {
                    Point3d pnt3dPick;
                    Entity  ent = Select.selectEntity(typeof(Polyline3d), "Select Brkline:", "Brkline selection failed.", out pnt3dPick);
                    poly3dFL   = (Polyline3d)ent;                                   //this 3dPoly is from points and is linked to the points with "apps.lnkBrks" !!!!!!!!!!!!!!!!!!!!!!!!!!
                    idPoly3dFL = poly3dFL.ObjectId;
                    ResultBuffer rb = idPoly3dFL.getXData(null);
                    if (rb == null)
                    {
                        return;
                    }
                }
                else if (Grading_Palette.gPalette.pGrading.optPNTS.IsChecked == true)
                {
                    ObjectId idPoly = ObjectId.Null;
                    try
                    {
                        idPoly3dFL = BrkLine.makeBreakline(apps.lnkBrks2, "BC", out idPoly);         //this 3dPoly is from points and is linked to the points with "lnkBrks2"    OK.
                    }
                    catch (System.Exception ex)
                    {
                        BaseObjs.writeDebug(ex.Message + " cmdBC.cs: line: 58");
                    }
                }

                try
                {
                    using (Transaction tr = BaseObjs.startTransactionDb())
                    {
                        poly3dFL = (Polyline3d)tr.GetObject(idPoly3dFL, OpenMode.ForRead);
                        pnt3dBEG = poly3dFL.StartPoint;
                        pnt3dEND = poly3dFL.EndPoint;
                        PromptStatus ps;
                        pnt3dX = UserInput.getPoint("Pick point Back of Curb adjacent to segment", pnt3dBEG, out escape, out ps, osMode: 8);
                        if (pnt3dX == Pub.pnt3dO || escape)
                        {
                            SnapMode.setOSnap(snapMode);
                            return;
                        }
                        if (Geom.testRight(pnt3dBEG, pnt3dEND, pnt3dX) > 0)
                        {
                            side = -1;
                        }
                        else
                        {
                            side = 1;
                        }

                        double offH1 = 0.5 * 1.25 * side;
                        double offV1 = userInput[0] + 0.0208;
                        double offH2 = userInput[1] * side;
                        double offV2 = userInput[2] * userInput[1];

                        List <Handle> handles = new List <Handle>();

                        ObjectId idPoly3dTC = buildTCandBench(offH1, offV1, idPoly3dFL, idPoly3dFL, false, ref handles);        // collect handles from TC, BB, CgPnt, GT
                        Grading_Dict.addBrksToPntXDict(idPoly3dFL, idPoly3dTC, offH1, offV1, 0.0, -1.0);

                        ObjectId idPoly3dBB = buildTCandBench(offH2, offV2, idPoly3dFL, idPoly3dTC, true, ref handles);
                        Grading_Dict.addBrksToPntXDict(idPoly3dFL, idPoly3dBB, offH1 + offH2, offV1 + offV2, 0.0, -1.0);

                        ObjectId idPolyBB = idPoly3dBB.addPoly("GB");
                        idPoly3dBB.moveBottom();
                        handles.Add(idPolyBB.getHandle());
                        idPoly3dBB.moveToTop();

                        if (nameCmd == "cmdBG")
                        {
                            double offH3 = userInput[3] * side * -1;
                            double offV3 = userInput[4];

                            ObjectId idPoly3dLP = buildTCandBench(offH3, offV3, idPoly3dFL, idPoly3dFL, true, ref handles);
                            Grading_Dict.addBrksToPntXDict(poly3dFL.ObjectId, idPoly3dLP, offH3, offV3, 0.0, -1.0);

                            ObjectId idPolyGT = idPoly3dLP.addPoly("Gutter");
                            idPolyGT.moveBottom();
                            handles.Add(idPolyGT.getHandle());

                            idPoly3dLP.moveToTop();
                        }

                        idPoly3dFL.setXData(handles, apps.lnkBrks3);

                        SnapMode.setOSnap(snapMode);

                        tr.Commit();
                    }
                }
                catch (System.Exception ex)
                {
                    BaseObjs.writeDebug(ex.Message + " cmdBC.cs: line: 123");
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " cmdBC.cs: line: 128");
            }
        }
Beispiel #3
0
        BV()
        {
            int snapMode = SnapMode.getOSnap();

            try
            {
                ObjectId idPoly3dFL = ObjectId.Null;
                ObjectId idPoly3dOP = ObjectId.Null;
                ObjectId idPoly3dLT = ObjectId.Null;
                ObjectId idPoly3dRT = ObjectId.Null;

                List <Point3d> pnts3dFL = null;
                List <Point3d> pnts3dRF = null;
                List <Point3d> pnts3dOP = null;

                List <Handle> handles3 = null;

                ObjectIdCollection ids      = null;
                Point3d            pnt3dBEG = Pub.pnt3dO;

                double width = double.Parse(fGrading.cmdBV_GutterWidth);
                UserInput.getUserInput("\nGutter Width in Feet: ", out width, width);

                if (width == -99.99)
                {
                    return;
                }

                fGrading.cmdBV_GutterWidth = width.ToString();
                Dict.setCmdDefault("cmdBV", "GUTTERWIDTH", width.ToString());

                double deltaZ = double.Parse(fGrading.cmdBV_GutterDepth);
                UserInput.getUserInput("\nGutter Depth in Feet: ", out deltaZ, deltaZ);

                if (deltaZ == -99.99)
                {
                    return;
                }

                fGrading.cmdBV_GutterDepth = deltaZ.ToString();
                Dict.setCmdDefault("cmdBV", "GUTTERDEPTH", deltaZ.ToString());

                ObjectId idPoly3dRF = ObjectId.Null;
                ObjectId idPolyRF   = ObjectId.Null;
                ObjectId idPolyFL   = ObjectId.Null;

                switch (fGrading.cmdBV_Source)      //SOURCE
                {
                case "BRKLINE":
                    Type         type = typeof(Polyline3d);
                    TypedValue[] tvs  = new TypedValue[2];
                    tvs.SetValue(new TypedValue((int)DxfCode.Start, RXClass.GetClass(type).DxfName), 0);
                    tvs.SetValue(new TypedValue((int)DxfCode.LayerName, "CPNT_BRKLINE"), 1);

                    SelectionSet ss = Select.buildSSet(tvs);
                    ss.moveToTop();

                    idPoly3dRF = Select.getBrkLine("Select 3d Breakline: ");
                    if (idPoly3dRF == ObjectId.Null)
                    {
                        return;
                    }

                    if (fGrading.optFL.IsChecked == true)
                    {
                        idPolyFL = idPoly3dRF.toPolyline("FL");
                    }

                    if (fGrading.optEDGE.IsChecked == true)
                    {
                        idPolyRF = idPoly3dRF.toPolyline("GUTTER");
                    }

                    break;

                case "POINTS":

                    if (fGrading.optFL.IsChecked == true)
                    {
                        try
                        {
                            idPoly3dFL = BrkLine.makeBreakline(apps.lnkBrks2, "cmdBV", out idPolyFL);            //make breakline and store endPoints on breakline, store breakline on endpoints

                            if (idPoly3dFL == ObjectId.Null)
                            {
                                return;
                            }
                            pnts3dFL   = idPoly3dFL.getCoordinates3dList();
                            idPoly3dRF = idPoly3dFL;
                            pnts3dRF   = pnts3dFL;
                            pnt3dBEG   = idPoly3dFL.getBegPnt();
                        }
                        catch (System.Exception ex)
                        {
                            BaseObjs.writeDebug(ex.Message + " cmdBV.cs: line: 99");
                        }
                    }
                    else if (fGrading.optEDGE.IsChecked == true)
                    {
                        try
                        {
                            idPoly3dRF = BrkLine.makeBreakline(apps.lnkBrks2, "cmdRF", out idPolyRF);
                            if (idPoly3dRF == ObjectId.Null)
                            {
                                return;
                            }
                            pnts3dRF = idPoly3dRF.getCoordinates3dList();
                            pnt3dBEG = idPoly3dRF.getBegPnt();
                        }
                        catch (System.Exception ex)
                        {
                            BaseObjs.writeDebug(ex.Message + " cmdBV.cs: line: 114");
                        }
                    }
                    break;
                }

                int i = 0;

                List <SEG_PROP> segProps = pnts3dRF.getPoly3dSegProps();

                double offFL     = width / 2;
                double xSlopeFL  = deltaZ / offFL;
                double offOP     = width; //opposite side
                double xSlopeOP  = 0.00;
                string nameLayer = "CPNT-BRKLINE";

                PromptStatus ps;

                switch (fGrading.cmdBV_Control)     //CONTROL
                {
                case "EDGE":
                    pnts3dOP = new List <Point3d>();
                    bool    escape    = false;
                    int     side      = -1;
                    Point3d pnt3dPick = UserInput.getPoint("Pick point on FL side of Gutter Edge.", pnt3dBEG, out escape, out ps, osMode: 0);
                    if (escape || pnt3dPick == Pub.pnt3dO)
                    {
                        SnapMode.setOSnap(snapMode);
                        return;
                    }
                    for (i = 1; i < pnts3dRF.Count; i++)
                    {
                        double length   = pnts3dRF[i - 1].getDistance(pnts3dRF[i + 0]);
                        double distance = pnt3dPick.getOrthoDist(pnts3dRF[i - 1], pnts3dRF[i + 0]);

                        if (distance > 0 && distance < length)
                        {
                            if (pnt3dPick.isRightSide(pnts3dRF[i - 1], pnts3dRF[i + 0]))
                            {
                                side = 1;     //otherwise default is -1
                                break;
                            }
                        }
                    }

                    if (i == pnts3dRF.Count - 1)
                    {
                        Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowAlertDialog("You have selected a point in the blind spot.");
                        SnapMode.setOSnap(snapMode);
                        return;
                    }

                    for (i = 0; i < segProps.Count; i++)
                    {
                        switch (side)
                        {
                        case 1:

                            if (i == 0)
                            {
                                pnts3dFL.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offFL, xSlopeFL));
                                pnts3dOP.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offOP, xSlopeOP));
                                continue;
                            }

                            if (segProps[i].DELTA == 0)
                            {
                                pnts3dFL.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offFL, xSlopeFL));
                                pnts3dOP.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offOP, xSlopeOP));
                            }
                            else if (segProps[i].DELTA > 0)
                            {
                                pnts3dFL.Add(Geom.doAnglePointOUT(segProps[i].BEG, xSlopeFL, segProps[i].DELTA, segProps[i - 1].DIR_AHEAD, -1, offFL));
                                pnts3dOP.Add(Geom.doAnglePointOUT(segProps[i].BEG, xSlopeOP, segProps[i].DELTA, segProps[i - 1].DIR_AHEAD, -1, offOP));
                            }
                            else if (segProps[i].DELTA < 0)
                            {
                                pnts3dFL.Add(Geom.doAnglePointIN(segProps[i].BEG, xSlopeFL, System.Math.Abs(segProps[i].DELTA), segProps[i].DIR_AHEAD, -1, offFL));
                                pnts3dOP.Add(Geom.doAnglePointIN(segProps[i].BEG, xSlopeOP, System.Math.Abs(segProps[i].DELTA), segProps[i].DIR_AHEAD, -1, offOP));
                            }

                            if (i == segProps.Count - 1)
                            {
                                pnts3dFL.Add(Geom.traverse_pnt3d(segProps[i].END, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offFL, xSlopeFL));
                                pnts3dOP.Add(Geom.traverse_pnt3d(segProps[i].END, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offOP, xSlopeOP));
                            }

                            break;

                        case -1:

                            if (i == 0)
                            {
                                pnts3dFL.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offFL, xSlopeFL));
                                pnts3dOP.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offOP, xSlopeOP));
                                continue;
                            }

                            if (segProps[i].DELTA == 0)
                            {
                                pnts3dFL.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offFL, xSlopeFL));
                                pnts3dOP.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offOP, xSlopeOP));
                            }
                            else if (segProps[i].DELTA > 0)
                            {
                                pnts3dFL.Add(Geom.doAnglePointIN(segProps[i].BEG, xSlopeFL, segProps[i].DELTA, segProps[i].DIR_AHEAD, 1, offFL));
                                pnts3dOP.Add(Geom.doAnglePointIN(segProps[i].BEG, xSlopeOP, segProps[i].DELTA, segProps[i].DIR_AHEAD, 1, offOP));
                            }
                            else if (segProps[i].DELTA < 0)
                            {
                                pnts3dFL.Add(Geom.doAnglePointOUT(segProps[i].BEG, xSlopeFL, System.Math.Abs(segProps[i].DELTA), segProps[i - 1].DIR_AHEAD, 1, offFL));
                                pnts3dOP.Add(Geom.doAnglePointOUT(segProps[i].BEG, xSlopeOP, System.Math.Abs(segProps[i].DELTA), segProps[i - 1].DIR_AHEAD, 1, offOP));
                            }

                            if (i == segProps.Count - 1)
                            {
                                pnts3dFL.Add(Geom.traverse_pnt3d(segProps[i].END, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offFL, xSlopeFL));
                                pnts3dOP.Add(Geom.traverse_pnt3d(segProps[i].END, segProps[i].DIR_AHEAD + PI / 2 * side, -1 * offOP, xSlopeOP));
                            }

                            break;
                        }
                    }

                    idPoly3dFL = Draw.addPoly3d(pnts3dFL, nameLayer);
                    Grading_Dict.addBrksToPntXDict(idPoly3dRF, idPoly3dFL, offFL, deltaZ, 0.0, -1.0);     //ADD EDGE HANDLE AND OFFSETS TO POINT EXTENSION DICTIONARY, ADD POINT HANDLES TO EDGE
                    idPolyFL = idPoly3dFL.toPolyline("FL");

                    idPoly3dOP = Draw.addPoly3d(pnts3dOP, nameLayer);
                    Grading_Dict.addBrksToPntXDict(idPoly3dRF, idPoly3dOP, offOP, 0.0, 0.0, -1.0);
                    ObjectId idPolyOP = idPoly3dOP.toPolyline("GUTTER");

                    handles3 = new List <Handle>();
                    handles3.Add(idPoly3dRF.getHandle());
                    handles3.Add(idPolyRF.getHandle());
                    handles3.Add(idPolyFL.getHandle());
                    handles3.Add(idPoly3dOP.getHandle());
                    handles3.Add(idPolyOP.getHandle());

                    ids = new ObjectIdCollection();
                    ids.Add(idPoly3dRF);
                    ids.Add(idPoly3dOP);

                    break;

                case "FL":

                    Point3dCollection pnts3dLT = new Point3dCollection();
                    Point3dCollection pnts3dRT = new Point3dCollection();

                    int x = segProps.Count;

                    for (i = 0; i < x; i++)
                    {
                        if (i == 0)
                        {
                            pnts3dLT.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2, 1 * offFL, xSlopeFL));
                            pnts3dRT.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD - PI / 2, 1 * offFL, xSlopeFL));
                        }
                        if (i > 0 && i < x)
                        {
                            if (segProps[i].DELTA == 0)
                            {
                                pnts3dLT.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD + PI / 2, 1 * offFL, xSlopeFL));
                                pnts3dRT.Add(Geom.traverse_pnt3d(segProps[i].BEG, segProps[i].DIR_AHEAD - PI / 2, 1 * offFL, xSlopeFL));
                            }
                            else if (segProps[i].DELTA > 0)
                            {
                                pnts3dLT.Add(Geom.doAnglePointIN(segProps[i].BEG, xSlopeFL, segProps[i - 1].DELTA, segProps[i - 1].DIR_AHEAD, -1, offFL));
                                pnts3dRT.Add(Geom.doAnglePointOUT(segProps[i].BEG, xSlopeFL, segProps[i - 1].DELTA, segProps[i - 0].DIR_AHEAD, 1, offFL));
                            }
                            else if (segProps[i].DELTA < 0)
                            {
                                pnts3dLT.Add(Geom.doAnglePointOUT(segProps[i].BEG, xSlopeFL, System.Math.Abs(segProps[i].DELTA), segProps[i - 0].DIR_AHEAD, -1, offFL));
                                pnts3dRT.Add(Geom.doAnglePointIN(segProps[i].BEG, xSlopeFL, System.Math.Abs(segProps[i].DELTA), segProps[i - 1].DIR_AHEAD, 1, offOP));
                            }
                        }
                        if (i == x - 1)
                        {
                            pnts3dLT.Add(Geom.traverse_pnt3d(segProps[i].END, segProps[i].DIR_AHEAD + PI / 2, 1 * offFL, xSlopeFL));
                            pnts3dRT.Add(Geom.traverse_pnt3d(segProps[i].END, segProps[i].DIR_AHEAD - PI / 2, 1 * offFL, xSlopeFL));
                        }
                    }

                    ObjectId idPolyLT = Draw.addPoly(pnts3dLT, "2dPoly");
                    idPoly3dLT = Draw.addPoly3d(pnts3dLT, nameLayer);
                    Grading_Dict.addBrksToPntXDict(idPoly3dFL, idPoly3dLT, -offFL, deltaZ, 0.0, -1.0);     //ADD EDGE HANDLE AND OFFSETS TO POINT EXTENSION DICTIONARY, ADD POINT HANDLES TO EDGE

                    ObjectId idPolyRT = Draw.addPoly(pnts3dRT, "2dPoly");
                    idPoly3dRT = Draw.addPoly3d(pnts3dRT, nameLayer);
                    Grading_Dict.addBrksToPntXDict(idPoly3dFL, idPoly3dRT, offFL, deltaZ, 0.0, -1.0);

                    handles3 = new List <Handle>();
                    handles3.Add(idPoly3dLT.getHandle());
                    handles3.Add(idPolyLT.getHandle());
                    handles3.Add(idPoly3dRT.getHandle());
                    handles3.Add(idPolyRT.getHandle());

                    ids = new ObjectIdCollection();
                    ids.Add(idPoly3dLT);
                    ids.Add(idPoly3dRT);
                    break;
                }

                Grading_GetNestedCurbObjects.getCurbFromXref(ids, idPoly3dFL, handles3);
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " cmdBV.cs: line: 322");
            }
            finally
            {
            }
        }
Beispiel #4
0
        processArcs(List <Arc> arcs, List <arcInfo> arcInfos, Arc arc0, List <ObjectId> idsCgPnt, string nameCmd, List <double> offHs, List <double> offVs)
        {
            ObjectId      idPoly  = ObjectId.Null;
            List <Handle> handles = new List <Handle>();
            ObjectId      idFL    = ObjectId.Null;

            for (int y = 0; y < arcs.Count; y++)
            {
                Arc            arc    = arcs[y];
                List <Point3d> pnts3d = new List <Point3d>();

                for (int p = 0; p < arcInfos.Count - 1; p++)
                {
                    Vector3d v3dBeg = new Vector3d(0, 0, 0);
                    Vector3d v3dEnd = new Vector3d(0, 0, 0);
                    for (int a = 0; a < y + 1; a++)
                    {
                        v3dBeg += arcInfos[p].v3ds[a];
                        v3dEnd += arcInfos[p + 1].v3ds[a];
                    }
                    Point3d pnt3dBeg = arcInfos[p].idCgPnt.getCogoPntCoordinates();
                    pnt3dBeg += v3dBeg;

                    Point3d pnt3dEnd = arcInfos[p + 1].idCgPnt.getCogoPntCoordinates();
                    pnt3dEnd += v3dEnd;

                    double dist = arcInfos[p].distToNext * arcs[y].Length / arc0.Length;

                    double grd = (pnt3dEnd.Z - pnt3dBeg.Z) / dist;

                    double staBeg = arcInfos[p].distFromBeg * arcs[y].Length / arc0.Length;
                    arc.traverse(pnt3dBeg, grd, dist, staBeg, ref pnts3d);
                }

                ObjectId idBrk = ObjectId.Null;

                if (y == 0)
                {
                    idFL = BrkLine.makeBreakline(apps.lnkBrks3, nameCmd, out idPoly, idsCgPnt, pnts3dL: pnts3d);
                    foreach (ObjectId id in idsCgPnt)
                    {
                        id.updatePntXData(idFL, apps.lnkBrks2);
                    }
                }
                else
                {
                    idBrk = BrkLine.makeBreakline(apps.lnkBrks, nameCmd, out idPoly, idsCgPnt, pnts3dL: pnts3d);
                    Grading_Dict.addBrksToPntXDict(idFL, idBrk, offHs[y], offVs[y], 0.0, -1);
                    if (y == 2)
                    {
                        using (Transaction tr = BaseObjs.startTransactionDb())
                        {
                            BlockTableRecord ms = Blocks.getBlockTableRecordMS();
                            idPoly = arcs[2].convertArcToPolyline("GB");
                            tr.Commit();
                        }
                        idPoly.moveBottom();
                        idBrk.moveToTop();
                    }
                    handles.Add(idBrk.getHandle());
                }

                BaseObjs.updateGraphics();
            }

            idFL.setXData(handles, apps.lnkBrks3);
        }