Exemplo n.º 1
0
        static void GenAllRcd()
        {
            DataTable AllRcd = new DataTable();

            AllRcd.Columns.Add("bridge", typeof(string));
            AllRcd.Columns.Add("class", typeof(string));
            AllRcd.Columns.Add("loc", typeof(string));
            AllRcd.Columns.Add("detial", typeof(string));
            AllRcd.Columns.Add("name", typeof(string));
            AllRcd.Columns.Add("spec", typeof(string));
            AllRcd.Columns.Add("quantity", typeof(double));
            AllRcd.Columns.Add("quantity2", typeof(double));
            AllRcd.Columns.Add("xmh", typeof(string));
            AllRcd.Columns.Add("NewID", typeof(string));
            //--------------------------------------------------------------------------------------
            //创建完善桥梁一览表数据
            //--------------------------------------------------------------------------------------
            DataTable LKBOB = Ext.GetDT(Resource1.LKBOB);
            DataTable RKBOB = Ext.GetDT(Resource1.RKBOB);
            List <Tuple <double, double> > LKDMX = Ext.GetBG(Resource1.LK_DMX);
            List <Tuple <double, double> > RKDMX = Ext.GetBG(Resource1.R2_DMX);

            RKDMX.AddRange(Ext.GetBG(Resource1.R3_DMX));
            RKDMX.AddRange(Ext.GetBG(Resource1.R4_DMX));
            RKDMX.AddRange(Ext.GetBG(Resource1.R5_1_DMX));
            RKDMX.AddRange(Ext.GetBG(Resource1.R5_2_DMX));
            RKDMX.AddRange(Ext.GetBG(Resource1.R5_3_DMX));
            RKDMX.AddRange(Ext.GetBG(Resource1.R6_DMX));
            SQX LK = new SQX("LK", Resource1.LK);
            SQX RK = new SQX("RK", Resource1.RK);



            Ext.AddNPTS(ref LKBOB);
            Ext.AddWidth(ref LKBOB);
            Ext.AddBeamType(ref LKBOB);
            Ext.AddBG(ref LKBOB, "DMX", ref LKDMX);
            Ext.AddSJXBG(ref LKBOB, "SJX", ref LK);
            Ext.AddGroupNum(ref LKBOB);
            Ext.AddGroupType(ref LKBOB);

            Ext.AddNPTS(ref RKBOB);
            Ext.AddWidth(ref RKBOB);
            Ext.AddBeamType(ref RKBOB);
            Ext.AddBG(ref RKBOB, "DMX", ref RKDMX);
            Ext.AddSJXBG(ref RKBOB, "SJX", ref RK);
            Ext.AddGroupNum(ref RKBOB);
            Ext.AddGroupType(ref RKBOB);

            //LKBOB.DataTableToCSV("左线桥梁");
            //RKBOB.DataTableToCSV("右线桥梁");
            //LKBOB.DataTableToExcel("左线桥梁", "1");
            //RKBOB.DataTableToExcel("右线桥梁", "1");


            //--------------------------------------------------------------------------------------
            //输出清单记录
            //--------------------------------------------------------------------------------------
            OutPut.SubStructure(ref AllRcd, ref LKBOB);
            OutPut.SupStructure(ref AllRcd, ref LKBOB);
            OutPut.Auxiliary(ref AllRcd, ref LKBOB);

            OutPut.SubStructure(ref AllRcd, ref RKBOB);
            OutPut.SupStructure(ref AllRcd, ref RKBOB);
            OutPut.Auxiliary(ref AllRcd, ref RKBOB);
            //--------------------------------------------------------------------------------------
            // 匹配桥梁信息
            //--------------------------------------------------------------------------------------

            AllRcd.AddInfo(ref LKBOB, ref RKBOB);


            AllRcd.DataTableToCSV("材料清单表");
            //AllRcd.DataTableToExcel("材料清单", "左线");



            //int dPK = 0;
            //List<double> dmbg = new List<double>();
            //List<double> sjbg = new List<double>();
            //DataTable DMXBG = new DataTable();
            //DMXBG.Columns.Add("PK", typeof(string));
            //DMXBG.Columns.Add("NoS", typeof(string));
            //DMXBG.Columns.Add("DMX", typeof(List<double>));
            //DMXBG.Columns.Add("SJX", typeof(List<double>));
            //DMXBG.Columns.Add("NPTS", typeof(int));
            //List<int> SpanList = new List<int>() { 10, 15, 25, 35, 50, 60 };


            //int rowIdx = 0;
            //int i = 0;
            //foreach (DataRow item in LKBG.Rows)
            //{
            //    var ff = from a in item.ItemArray select a.ToString();
            //    List<string> wds = ff.ToList();
            //    if (i == 0)
            //    {
            //        dmbg.Clear();
            //        sjbg.Clear();
            //    }
            //    else
            //    {
            //        var mm = from b in LKBG.Rows[i - 1].ItemArray select b.ToString();
            //        List<string> wdsBefore = mm.ToList();
            //        dPK = (int)Math.Round(double.Parse(wds[0]) - double.Parse(wdsBefore[0]), 0);
            //        if (SpanList.Contains(dPK))
            //        {
            //            ;

            //        }
            //        else
            //        {
            //            if ((string)LKBOB.Rows[rowIdx]["PK"] == "LK185+190.0")
            //            {
            //                ;

            //            }
            //            DMXBG.Rows.Add(LKBOB.Rows[rowIdx]["PK"], LKBOB.Rows[rowIdx]["NumOfSpan"], dmbg, sjbg, sjbg.Count);
            //            dmbg.Clear();
            //            sjbg.Clear();
            //            //dmbg = (List<double>)LKBOB.Rows[rowIdx]["DMBG"];
            //            //sjbg = (List<double>)LKBOB.Rows[rowIdx]["SJBG"];
            //            rowIdx++;
            //        }
            //    }



            //    dmbg.Add(double.Parse(wds[1]));
            //    sjbg.Add(double.Parse(wds[2]));

            //    i++;



            //}


            //ACadConnector.ExtrudeLevel("LK", 147545, 64.499);


            //ACadConnector.ExtrudeData("LKdata",147545,64.499);
        }