马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;;配置(布局)排序
- ;;;程序设计:赖云龙;;;
- ;;;---------------;;;
- (defun C:LAYOUT_SORT (/ OBJDICT GRPDICT OUTLIST KEY SL N NN BB A3)
- (setq OBJDICT (namedobjdict))
- (setq GRPDICT (dictsearch OBJDICT "ACAD_LAYOUT"))
- (setq KEY (getstring "\n大至小<L>/<小至大>: "))
- (if (= KEY "")
- (setq OUTLIST (acad_strlsort (layoutlist)))
- (setq OUTLIST (reverse (acad_strlsort (layoutlist))))
- )
- (setq SL (length OUTLIST))
- (setq NN 0)
- (repeat SL
- (setq BB (nth NN OUTLIST))
- (setq N 2)
- (while (/= (cdr (assoc 1
- (vl-member-if
- '(lambda (X) (= (cdr X) "AcDbLayout"))
- (entget (cdr (nth (+ 9 N) GRPDICT)))
- )
- )
- )
- BB
- )
- (setq N (+ 2 N))
- )
- (setq A3 (entget (cdr (nth (+ 9 N) GRPDICT))))
- (setq A3 (subst (cons 71 (+ 1 NN)) (assoc 71 A3) A3))
- (entmod A3)
- (setq NN (1+ NN))
- )
- (command "_.regen")
- (princ)
- )
- ;;;删除空白配置(布局)更新
- ;;;程序设计:赖云龙;;;
- ;;;---------------;;;
- (defun C:LAYOUT_DEL (/ HOLDECHO OUTLIST SL N LAYOUT_NAME A)
- (setq HOLDECHO (getvar "CMDECHO"))
- (setvar "CMDECHO" 0)
- (setq OUTLIST (LAYOUTLIST))
- (setq SL (length OUTLIST))
- (setq N 0)
- (repeat SL
- (setq LAYOUT_NAME (nth N OUTLIST))
- (setq A (ssget "X" (list (cons 410 LAYOUT_NAME))))
- (if (or (= NIL A) (= (sslength A) 1))
- (command "_.layout" "delete" LAYOUT_NAME)
- )
- (setq N (1+ N))
- )
- (setvar "CMDECHO" HOLDECHO)
- (princ)
- )
|