public static Table CreateTable(ICollection <FixtureDetails> FixtureDetails, InsertPoint insertPoint) { Table t = new Table(); //t.Layer = TableScheduleName.TableLayer; t.Width = TableScheduleName.Width; int rowsNum = 2 + FixtureDetails.Count; int columnsNum = 8; // table already has 1 row, 1 column, that's why we insert - 1; t.InsertRows(0, 1.5, rowsNum - 1); t.InsertColumns(0, 1, columnsNum - 1); //Merge the Title ROWS CellRange crTitle = CellRange.Create(t, 0, 0, 0, columnsNum - 1); t.MergeCells(crTitle); //GENERAL SETTINGS t.Cells.TextHeight = TableScheduleName.GeneralTextHeight; t.Cells.ContentColor = Color.FromColorIndex(ColorMethod.ByAci, 2); t.Cells.Alignment = CellAlignment.MiddleCenter; //Column Description -- Align Left t.Columns[columnsNum - 1].Alignment = CellAlignment.MiddleLeft; t.Cells[1, 7].Alignment = CellAlignment.MiddleCenter; //Set WIDTH FOR EARCH COLUMN: t.Columns[0].Width = 0.67; t.Columns[1].Width = 2; t.Columns[2].Width = 0.5; t.Columns[3].Width = 0.5; t.Columns[4].Width = 0.5; t.Columns[5].Width = 0.5; t.Columns[6].Width = 0.5; t.Columns[7].Width = 4.25; //Set General ROWS HEIGHT; for (int index = 0; index < rowsNum; index++) { t.Rows[index].Height = TableScheduleName.GeneralRowHeight; } t.Rows[0].Height = TableScheduleName.TitleRowHeight; t.Cells[0, 0].TextString = insertPoint.model.name; t.Cells[0, 0].TextHeight = TableScheduleName.TitleTextHeight; //SET UP SECOND ROW TITLES t.Rows[1].Height = 0.75; t.Cells[1, 0].TextString = "ITEM"; t.Cells[1, 1].TextString = "FIXTURE"; t.Cells[1, 2].TextString = "COLD WATER"; t.Cells[1, 2].Contents[0].Rotation = Math.PI / 2; t.Cells[1, 3].TextString = "HOT WATER"; t.Cells[1, 3].Contents[0].Rotation = Math.PI / 2; t.Cells[1, 4].TextString = "WASTE"; t.Cells[1, 4].Contents[0].Rotation = Math.PI / 2; t.Cells[1, 5].TextString = "VENT"; t.Cells[1, 5].Contents[0].Rotation = Math.PI / 2; t.Cells[1, 6].TextString = "STORM DRAIN"; t.Cells[1, 6].Contents[0].Rotation = Math.PI / 2; t.Cells[1, 7].TextString = "DESCRIPTION"; //Index starts at third orw; int i = 2; foreach (FixtureDetails FD in FixtureDetails) { t.Cells[i, 1].TextString = FD.model.FIXTURENAME; t.Cells[i, 2].TextString = returnTextStringFinalValue(NumberConverter.ConvertToFractionalNumber(FD.model.CW_DIA)); t.Cells[i, 3].TextString = returnTextStringFinalValue(NumberConverter.ConvertToFractionalNumber(FD.model.HW_DIA)); t.Cells[i, 4].TextString = returnTextStringFinalValue(NumberConverter.ConvertToFractionalNumber(FD.model.WASTE_DIA)); t.Cells[i, 5].TextString = returnTextStringFinalValue(NumberConverter.ConvertToFractionalNumber(FD.model.VENT_DIA)); t.Cells[i, 6].TextString = returnTextStringFinalValue(NumberConverter.ConvertToFractionalNumber(FD.model.STORM_DIA)); t.Cells[i, 7].TextString = FD.model.DESCRIPTION; i++; } t.Position = new Point3d(insertPoint.model.position.X, insertPoint.model.position.Y, insertPoint.model.position.Z); return(t); }
public static void UpdateSingleTable(InsertPoint IP, Database db) { }