本帖最后由 x_s_s_1 于 2019-12-29 23:55 编辑
也就是几行,但是不保证正确性,请您自己测试:
- (defun c:test1 (/ oldcmd layouts lst n)
- (setq oldcmd(getvar"cmdecho"))
- (setvar"cmdecho"0)
- (setq layouts (vla-get-layouts
- (vla-get-activedocument (vlax-get-acad-object))
- )
- )
- (vlax-for layout layouts
- (setq lst (cons (vlax-get-property layout 'name) lst))
- )
- (setq lst (vl-sort (vl-remove "Model" lst)
- '(lambda (e1 e2) (< (atoi e1) (atoi e2)))
- )
- lst (append lst (list (itoa (1+ (atoi (last lst))))))
- n (length lst)
- )
- (vl-cmdf "layout" "c" "" (last lst))
- (foreach x lst (vla-put-taborder (vla-item layouts x) n))
- (setvar "ctab"(last lst))
- (setvar"cmdecho"oldcmd)
- (princ)
- )
|