;;; Sort Layouts in one click (Lee Mac routine from here: https://www.theswamp.org/index.php?topic=51401.0 )

(defun c:sl ( )
( (lambda ( lst )
(vlax-map-collection (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
'(lambda ( lay / pos )
(if (setq pos (vl-position (vla-get-name lay) lst))
(vla-put-taborder lay (1+ pos))
)
)
)
)
(layoutlist)
)
)
(c:sl)

Advertisements