马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;BY 龙龙仔(LUCAS)
- ;;对操作ACAD_TABLE物件的重要函数(取得储存格范围)
- ;;注意:要先把指令做成按钮
- (defun SELECT_TABLE (/ TABLE ROWMIN ROWMAX COLMIN COLMAX SS N)
- (setq N 0)
- (if (setq SS (ssget "X" '((0 . "ACAD_TABLE"))))
- (repeat (sslength SS)
- (if (not (vl-catch-all-apply
- 'vla-getsubselection
- (list (vlax-ename->vla-object
- (ssname SS N)
- )
- 'ROWMIN
- 'ROWMAX
- 'COLMIN
- 'COLMAX
- )
- )
- )
- (setq TABLE (vlax-ename->vla-object
- (ssname SS N)
- )
- )
- )
- (setq N (1+ N))
- )
- )
- (if ROWMIN
- (list TABLE ROWMIN ROWMAX COLMIN COLMAX)
- (progn
- (prompt "\n没有选取任何储存格!!")
- NIL
- )
- )
- )
- ;;例子:合并储存格
- (defun C:MRGCELLS (/ C1 MAXCOL MAXROW MINCOL MINROW)
- (if (setq C1 (SELECT_TABLE))
- (progn
- (setq MINROW (nth 1 C1)
- MAXROW (nth 2 C1)
- MINCOL (nth 3 C1)
- MAXCOL (nth 4 C1)
- )
- (if (vl-catch-all-apply
- 'vlax-invoke
- (list (car C1) 'MERGECELLS MINROW MAXROW MINCOL MAXCOL)
- )
- (princ "\n储存格不能被合并!!")
- )
- )
- )
- (princ)
- )
- ;;例子:分解储存格
- (defun C:UNMRGCELLS (/ C1 MAXCOL MAXROW MINCOL MINROW)
- (if (setq C1 (SELECT_TABLE))
- (progn
- (setq MINROW (nth 1 C1)
- MAXROW (nth 2 C1)
- MINCOL (nth 3 C1)
- MAXCOL (nth 4 C1)
- )
- (if (vl-catch-all-apply
- 'vlax-invoke
- (list (car C1) 'UNMERGECELLS MINROW MAXROW MINCOL MAXCOL)
- )
- (princ "\n储存格不能被分解!!")
- )
- )
- )
- (princ)
- )
|