各位大手!帮忙看看: [CommandMethod("AddHead")] public void AddHead() { [CommandMethod("addTableHead")] public void addTableHead() { newTableHead(new Point3d(150, 150, 0), "测试", "80%"); } /// <summary> /// /// </summary> /// <param name="position"></param> /// <param name="strshjLX"></param> /// <param name="strShJbfbi"></param> public void newTableHead(Point3d position ,string strshjLX,string strShJbfbi) { Database db = HostApplicationServices.WorkingDatabase; Table tableHead = new Table(); //插入列 tableHead.InsertColumns(0, 40, 1); tableHead.InsertColumns(2, 40, 1); tableHead.InsertColumns(3, 40, 1); tableHead.InsertColumns(4, 40, 1); //插入行 tableHead.InsertRows(0, 15, 1); tableHead.SetTextString(0, 0, "内蒙古"); tableHead.SetTextString(0, 1, "山东省"); tableHead.SetTextString(0, 2, "河南省"); tableHead.SetTextString(0, 3, "西伯利亚"); tableHead.SetTextString(0, 4, "西伯利亚山东"); //第二行 tableHead.SetTextString(1, 3, strshjLX); tableHead.SetTextString(1, 4, strShJbfbi); //开始事务 using (Transaction trans =db.TransactionManager .StartTransaction ()) { //打开当前的文档 BlockTable bt = (BlockTable ) trans.GetObject(db.BlockTableId, OpenMode.ForRead); BlockTableRecord btr =(BlockTableRecord ) trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite); btr.AppendEntity(tableHead); trans.AddNewlyCreatedDBObject(tableHead, true); trans.Commit(); }
往cad中插入表格:但不知道第一行第二列的文字内容排列怎么变成了竖排!其他行都是横排,怎么让这一行也变成横排啊? |