;| Layout Name Equal to Filename - LNE.LSP
-------------------------------------------------------------------------------

Renames all the layouts with the filename
and a consecutive number

Translated to English by Igal Averbuh 2016

-------------------------------------------------------------------------------
Copyright (C) 2006 Markus Hoffmann
http://www.CADmaro.de
-------------------------------------------------------------------------------
FREEWARE:

-------------------------------------------------------------------------------
|;
(defun c:lne ()
(vl-load-com)
(vlax-for i (vlax-get-property
(vlax-get-property
(vlax-get-acad-object)
'ActiveDocument
)
'Layouts
)
(if (/= 0 (vlax-get-property i 'TabOrder))
(if
(vl-catch-all-error-p
(vl-catch-all-apply
'vlax-put-property
(list
i
'Name
(strcat
(vl-filename-base (getvar "DWGNAME"))
"_"
(itoa (vlax-get-property i 'TabOrder))
)

)
)
)
(princ
(strcat
"\nLayout "
(vlax-get-property i 'Name)
" could not be renamed because the name was already in use."
)
)
)
)
)
)

(c:lne)

Advertisements