Example #1
0
        public void ReadGridtData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

            conn = new SQLiteConnection(@"Data Source = " + Path);
            conn.Open();

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,Jt1ID,Jt2ID,AxisID FROM tblGrid";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Grid grid = new Grid();

                grid.ID       = reader.GetInt64(0);
                grid.StdFlrID = reader.GetInt64(1);
                grid.Jt1ID    = reader.GetInt64(2);
                grid.Jt2ID    = reader.GetInt64(3);

                StoryModel storyModel = GetStdStoryModel(grid.StdFlrID);
                grid.Jt1 = storyModel.GetJoint(grid.Jt1ID);
                grid.Jt2 = storyModel.GetJoint(grid.Jt2ID);

                storyModel.Grids.Add(grid);
            }
        }
Example #2
0
        /// <summary>
        /// 读取柱构件信息
        /// </summary>
        public void ReadColData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

            conn = new SQLiteConnection(@"Data Source = " + Path);
            conn.Open();

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,SectID,JtID FROM tblColSeg";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Column column = new Column();
                column.ID       = reader.GetInt64(0);
                column.StdFlrID = reader.GetInt64(1);
                column.SectID   = reader.GetInt64(2);
                column.JtID     = reader.GetInt64(3);

                StoryModel storyModel = GetStdStoryModel(column.StdFlrID);
                column.Jt      = storyModel.GetJoint(column.JtID);
                column.colSect = GetColSect(column.SectID);
                //column.Grid.Jt1 = column.Jt.Point;
                //column.Grid.Jt2 = new Point3d(column.Jt.Point.X, column.Jt.Point.Y, 0);
                column.ExtrudeDirection = new Vector3d(0, 0, -1 * storyModel.Height);

                column.GetSectPolyLineCurve();
                column.GetColumnSurface();

                storyModel.Columns.Add(column);
            }
        }