马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 牢固 于 2013-7-6 12:26 编辑
![](source/plugin/imc_colorcode/images/loading.gif) - (defun XD::Table:GetCellID (TABLE ROW COL / INSPT
- ROWS COLS R ROWHEIGHTS
- C B YL COLWIDTHS
- XL ang mat invmat el dxf11 dxf210
- )
- (if (xdrx_table_IsMergedCell TABLE ROW COL)
- (progn
- (setq inspt (cdr (assoc 10 (setq el (entget table))))
- dxf11 (cdr (assoc 11 el))
- ang (atan (cadr dxf11) (car dxf11))
- dxf210 (cdr (assoc 210 el))
- mat (MAT:Rotation3D InsPt dxf210 (- ang))
- invmat (xdrx_matrix_inverse mat)
- )
- (setq rows (fix (XDRX_TABLE_NUMROWS table))
- cols (fix (xdrx_table_NumColumns table))
- r -1
- )
- (repeat rows
- (setq RowHEIGHTs
- (cons (XDRX_TABLE_RowHEIGHT table (setq r (1+ r)))
- RowHEIGHTs
- )
- )
- )
- ;;各行的行高
- (setq RowHEIGHTs
- (reverse RowHEIGHTs)
- c -1
- )
- ;;yl = 各行的Y坐标
- (setq b 0
- yl (mapcar '(lambda (x) (setq b (- b x)))
- (reverse (cdr (reverse (cons 0 RowHEIGHTs))))
- )
- )
- (repeat cols
- (setq
- ColWidths
- (cons (xdrx_table_ColumnWidth table (setq c (1+ c)))
- ColWidths
- )
- )
- )
- ;;xl = 各列的Y坐标
- (setq b 0
- xl (mapcar '(lambda (x) (setq b (+ b x)))
- (reverse (cdr (reverse (cons 0 ColWidths))))
- )
- )
- ;;各列的列宽
- (setq ColWidths (reverse ColWidths))
- (xdrx_table_HitTest
- table
- (xdrx_point_transform
- (mapcar '+
- inspt
- (list (nth COL xl) (nth ROW yl) 0)
- (list (* 0.5 (nth COL ColWidths))
- (* -0.5 (nth ROW RowHEIGHTs))
- 0
- )
- ) invmat
- )
- '(0 0 1)
- 5.0
- 5.0
- )
- )
- (list Row Col)
- )
- )
|