马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 Lispboy 于 2016-7-19 01:14 编辑
- (defun XD::Table:setMerge (tb minrow maxrow mincol maxcol / ); bent box col el el1 ex handle n row typ x xdir)
- (setq typ (XD::Table:TYPE tb)
- xdir (XD::Table:direction tb)
- )
- (cond
- ((= typ "X")
- (setq el (xdrx_block_getentities tb)
- el1 nil
- )
- (foreach n el
- (setq ex (xdrx_object_getxrecord n "no")
- row (atoi (car ex))
- col (atoi (cadr ex))
- )
- (if (and
- (>= row minrow)
- (<= row maxrow)
- (>= col mincol)
- (<= col maxcol)
- )
- (progn
- (setq el1 (cons n el1))
- )
- )
- )
- (if (setq box (xdrx_entity_box el1 xdir))
- (progn
- (XD::Table:drawcell tb (last box) (distance (car box)
- (cadr box)
- ) (distance (cadr box)
- (caddr box)
- )
- )
- (setq bent (car (xdrx_block_appendentity (car
- (xdrx_getpropertyvalue tb "blocktablerecord")
- ) (entlast) t
- )
- )
- )
- (xdrx_object_setxrecord bent "MergeCell" 1)
- (xdrx_object_setxrecord bent "no" (list (itoa minrow)
- (itoa mincol)
- )
- )
- (xdrx_object_setxrecord bent "scope" (list minrow maxrow mincol
- maxcol
- )
- )
- (setq handle (xdrx_getpropertyvalue bent "handle"))
- (mapcar '(lambda(x)(xdrx_object_setxrecord x "MergeCellEnt" handle))el1)
- (xdrx_entity_setproperty el1 "visibility" nil)
- (xdrx_object_setxrecord tb "mergecells" (cons
- handle
- (xdrx_object_getxrecord tb "mergecells")
- )
- )
- (xdrx_object_regen tb)
- )
- )
- )
- ((= typ "A")
- (xdrx_table_mergecells tb minrow maxrow mincol maxcol)
- )
- ((= typ "E")
- (xdex_sheet_setMerge minrow maxrow mincol maxcol)
- )
- )
- )
|