Ejemplo n.º 1
0
        updateDictSTAKE()
        {
            Dict.deleteDictionary("STAKE");
            bool     exists      = false;
            ObjectId idDictSTAKE = Dict.getNamedDictionary("STAKE", out exists);

            List <AlgnData> algnData = fStake.algnData;

            for (int i = 0; i < algnData.Count; i++)
            {
                ObjectId idAlign = algnData[i].AlignID;
                if (idAlign.IsValid && !idAlign.IsErased)
                {
                    Alignment align   = Align.getAlignment(idAlign);
                    ObjectId  idDictX = Dict.getNamedDictionary(i.ToString(), out exists);

                    TypedValue[] tvs = new TypedValue[1];
                    tvs.SetValue(new TypedValue(1000, align.Name), 0);
                    Dict.addXRec(idDictX, "STAKE", new ResultBuffer(tvs));

                    tvs = new TypedValue[1];
                    tvs.SetValue(new TypedValue(1005, align.Handle), 0);
                    Dict.addXRec(idDictX, "STAKE", new ResultBuffer(tvs));

                    tvs = new TypedValue[1];
                    tvs.SetValue(new TypedValue(1000, align.ObjectId), 0);
                    Dict.addXRec(idDictX, "STAKE", new ResultBuffer(tvs));

                    tvs = new TypedValue[1];
                    tvs.SetValue(new TypedValue(1000, align.Layer), 0);
                    Dict.addXRec(idDictX, "STAKE", new ResultBuffer(tvs));

                    tvs = new TypedValue[1];
                    tvs.SetValue(new TypedValue(1000, algnData[i].TableHandle), 0);
                    Dict.addXRec(idDictX, "STAKE", new ResultBuffer(tvs));
                }
            }

            Stake_Dict.printDictionary();
        }
Ejemplo n.º 2
0
        makeTable(ObjectId idAlign, List <POI> varpoi, AlgnData varAlignData = null, object varPntUpper = null)
        {
            Alignment objAlign = (Alignment)idAlign.getEnt();

            string strLayerName = "TABLES";

            Layer.manageLayers(strLayerName);
            Extents3d ext3d;
            Point3d   pnt3dMin = Pub.pnt3dO, pnt3dMax = Pub.pnt3dO, pnt3dIns = Pub.pnt3dO;
            Table     objTable = null;
            ObjectId  idTable  = ObjectId.Null;

            int    numRows   = varpoi.Count + 2;
            int    numCols   = 33;
            double rowHeight = 5;
            double colWidth  = 30;

            if ((varAlignData == null))
            {
                if ((varPntUpper == null))
                {
                    ProfileView objProfileView = (ProfileView)fStake.HandleProfileView.getEnt();
                    ext3d    = (Extents3d)objProfileView.Bounds;
                    pnt3dMin = ext3d.MinPoint;
                    pnt3dMax = ext3d.MaxPoint;
                    pnt3dIns = new Point3d(pnt3dMax.X + 10, pnt3dMax.Y, 0);

                    idTable = Draw.addTable(pnt3dIns, numRows, numCols, rowHeight, colWidth);

                    AlgnData algnData = new AlgnData();
                    algnData.AlignName   = objAlign.Name;
                    algnData.AlignHandle = objAlign.Handle;
                    algnData.AlignLayer  = objAlign.Layer;
                    algnData.AlignID     = objAlign.ObjectId;
                    algnData.TableHandle = idTable.getHandle();

                    fStake.algnData.Add(algnData);
                }
                else //for WALL only
                {
                    pnt3dIns = new Point3d(pnt3dMax.X + 10, pnt3dMax.Y, 0);

                    idTable = Draw.addTable(pnt3dIns, numRows, numCols, rowHeight, colWidth);
                    AlgnData algnData = new AlgnData();
                    algnData.AlignName   = objAlign.Name;
                    algnData.AlignHandle = objAlign.Handle;
                    algnData.AlignLayer  = objAlign.Layer;
                    algnData.AlignID     = objAlign.ObjectId;
                    algnData.TableHandle = idTable.getHandle();

                    fStake.algnData.Add(algnData);
                }
            }
            else
            {
                ProfileView objProfileView = (ProfileView)fStake.HandleProfileView.getEnt();
                ext3d    = (Extents3d)objProfileView.Bounds;
                pnt3dMin = ext3d.MinPoint;
                pnt3dMax = ext3d.MaxPoint;
                pnt3dIns = new Point3d(pnt3dMax.X + 10, pnt3dMax.Y, 0);
                idTable  = Draw.addTable(pnt3dIns, numRows, numCols, rowHeight, colWidth);
                varAlignData.TableHandle = idTable.getHandle();
            }

            using (Transaction tr = BaseObjs.startTransactionDb())
            {
                objTable = (Table)tr.GetObject(idTable, OpenMode.ForWrite);

                objTable.Layer      = strLayerName;
                objTable.ColorIndex = 41;

                objTable.SuppressRegenerateTable(true);

                objTable.Cells[0, 0].TextString = objAlign.Name;

                objTable.Cells[1, 0].TextString = "INDEX";

                objTable.Cells[1, 1].TextString  = "CLASS";
                objTable.Cells[1, 2].TextString  = "DESCO";
                objTable.Cells[1, 3].TextString  = "DESCX";
                objTable.Cells[1, 4].TextString  = "STATION";
                objTable.Cells[1, 5].TextString  = "OFFSET";
                objTable.Cells[1, 6].TextString  = "ELEVATION";
                objTable.Cells[1, 7].TextString  = "TOW";
                objTable.Cells[1, 8].TextString  = "TOF";
                objTable.Cells[1, 9].TextString  = "INVERT";
                objTable.Cells[1, 10].TextString = "SIZE";

                objTable.Cells[1, 11].TextString = "ANGDELTA";
                objTable.Cells[1, 12].TextString = "ANGDIR";
                objTable.Cells[1, 13].TextString = "ANGCHORD";
                objTable.Cells[1, 14].TextString = "ISRIGHTHAND";
                objTable.Cells[1, 15].TextString = "ISCLOSED";
                objTable.Cells[1, 16].TextString = "ISSTEP";
                objTable.Cells[1, 17].TextString = "CROSSDESC";
                objTable.Cells[1, 18].TextString = "CROSSALIGN";
                objTable.Cells[1, 19].TextString = "CROSSALIGNINV";
                objTable.Cells[1, 20].TextString = "CROSSALIGNSTA";

                objTable.Cells[1, 21].TextString = "CROSSALIGNSIZE";
                objTable.Cells[1, 22].TextString = "PNTNUM";
                objTable.Cells[1, 23].TextString = "PNTSOURCE";
                objTable.Cells[1, 24].TextString = "TYPE";
                objTable.Cells[1, 25].TextString = "BULGE";
                objTable.Cells[1, 26].TextString = "RADIUS";
                objTable.Cells[1, 27].TextString = "SIDE";
                objTable.Cells[1, 28].TextString = "SLOPEAHEAD";
                objTable.Cells[1, 29].TextString = "SLOPEBACK";
                objTable.Cells[1, 30].TextString = "SLOPEH2H";

                objTable.Cells[1, 31].TextString = "XCEN";
                objTable.Cells[1, 32].TextString = "YCEN";

                objTable.Columns[0].Width  = 18.0;
                objTable.Columns[1].Width  = 18.0;
                objTable.Columns[4].Width  = 18.0;
                objTable.Columns[5].Width  = 18.0;
                objTable.Columns[6].Width  = 18.0;
                objTable.Columns[9].Width  = 18.0;
                objTable.Columns[10].Width = 18.0;

                for (int i = 0; i < objTable.Rows.Count; i++)
                {
                    for (int j = 0; j < objTable.Columns.Count; j++)
                    {
                        objTable.Cells[i, j].TextHeight = 0.09 * Misc.getCurrAnnoScale();
                        objTable.Cells[i, j].Alignment  = CellAlignment.MiddleCenter;
                    }
                }

                objTable.SuppressRegenerateTable(false);
                tr.Commit();
            }

            TypedValue[] tvs = new TypedValue[2] {
                new TypedValue(1001, "TABLE"), new TypedValue(1005, objTable.Handle)
            };
            objAlign.ObjectId.setXData(tvs, "TABLE");

            Stake_Dict.updateDictSTAKE();

            return(objTable.ObjectId);
        }