Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
this rename layout from "1" to any number. adding prefix and suffix.
I need an option to start the count from 1 or 01 or 001 or 0001...
(defun c:TabInc (/ pre suf num) ;; Tab Increment ;; Rename layout tabs with number, based on location ;; Prefix and Suffix optional ;; Alan J. Thompson, 02.25.09 / 04.08.10 / 12.16.10 (setq pre (getstring T "\nSpecify prefix <None>: ")) (setq suf (getstring T "\nSpecify suffix <None>: ")) (initget 6) (setq num (1- (cond ((getint "\nSpecify starting number <1>: ")) (1) ) ) ) (vlax-for x (vla-get-layouts (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object) ) ) ) ) ) (vl-catch-all-apply (function vla-put-name) (list x (strcat (rtos (getvar 'date) 2 16) "-" (itoa (vla-get-taborder x)))) ) ) (vlax-for x (vla-get-layouts *AcadDoc*) (vl-catch-all-apply (function vla-put-name) (list x (strcat pre (itoa (+ num (vla-get-taborder x))) suf)) ) ) (princ) )
Solved! Go to Solution.