;; | ---------------------------------------------------------------------------- ;; | MI_CreateTable ;; | ---------------------------------------------------------------------------- ;; | Function : Creates a table using the AutoCAD 2005 Table command ;; | Arguments: 'nRows' - Number of data rows in the table ;; | 'nCols' - Number of data columns in the table ;; | 'Insp' - Insertion point of table ;; | 'TitleHgt' - Height of Title text ;; | 'DescHgt' - Height of description height ;; | 'TextHgt' - Height of data(body) text ;; | 'RowHgt' - Row Height ;; | 'ColWid' - Column width ;; | 'Title' - Main title of the table ;; | 'DescLst' - List of description strings for the columns ;; | 'RowTabLst' - Nested list of rows of data belonging to the table ;; | cells. ;; | Returns : None ;; | Updated : February 2, 2005 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun MI_CreateTable ( nRows nCols Insp TitleHgt DescHgt TextHgt RowHgt ColWid Title DescLst RowTabLst / itm Table curRow curCol ) (setq #ModelSpace (AX_GetModelSpace) Table (vlax-invoke-method #ModelSpace 'AddTable (vlax-3d-point Insp) (+ nRows 2) nCols RowHgt ColWid) curRow 1 ) (vla-ClearTableStyleOverrides Table 0) (vla-setText Table 0 0 Title) (vla-setCellTextHeight Table 0 0 TitleHgt) (vla-setCellAlignment Table 0 0 acMiddleCenter) (setq curCol 0) (foreach itm DescLst (vla-setText Table 1 curCol itm) (vla-setCellAlignment Table 1 CurCol acMiddleCenter) (vla-setCellTextHeight Table 1 CurCol DescHgt) (setq curCol (1+ curCol)) ) (setq curRow 2) (foreach Row RowTabLst (setq curCol 0) (foreach itm Row (vla-setText Table curRow curCol itm) (vla-setCellAlignment Table curRow curCol acMiddleCenter) (vla-setCellTextHeight Table curRow curCol TextHgt) (setq curCol (1+ curCol)) ) (setq curRow (1+ curRow)) ) )