Keith, man you are fast...
Here is a lisp version.
;;; FUNCTION
;;; This routine will rename all layout tabs with
;;; user entered prefix & number or letter suffix
;;;
;;; ARGUMENTS
;;; none
;;;
;;; USAGE
;;; re-name-layouts
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2004 Charles Alan Butler
;;; ab2draft@TampaBay.rr.com
;;;
;;; VERSION
;;; 1.0 Oct. 01, 2004
;;;
;;; This software is provided "as is" without express or implied ;
;;; warranty. All implied warranties of fitness for any particular ;
;;; purpose and of merchantability are hereby disclaimed. ;
;;; You are hereby granted permission to use, copy and modify this ;
;;; software without charge, provided you do so exclusively for ;
;;; your own use or for use by others in your organization in the ;
;;; performance of their normal duties, and provided further that ;
;;; the above copyright notice appears in all copies and both that ;
;;; copyright notice and the limited warranty and restricted rights ;
;;; notice appear in all supporting documentation. ;
;;;
(defun c:re-name-layouts (/ tab_name doc cnt x suffix new_list)
(vl-load-com)
(setq tab_name (getstring t "\nEnter Tab Name prefix (add trailing space): "))
(cond (tab_name) ((setq tab_name "")))
(initget "Numbers Letters")
(setq suffix (getkword "\nSuffix to use? [Numbers or Letters] : <Numbers> "))
(cond (suffix) ((setq suffix "Numbers")))
(setq *doc* (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for tab (vla-get-layouts ; get list of layout tabs
(vla-get-activedocument (vlax-get-acad-object)))
(if (/= (setq tmpname (vla-get-name tab)) "Model") ; omit MODEL space
(setq new_list (cons (cons (vla-get-taborder tab) tab) new_list))
)
)
;; sort list acording to tab order
(setq new_list (vl-sort new_list
'(lambda (e1 e2) (< (car e1) (car e2)))))
;;remove the taborder numbers
(setq new_list (mapcar 'cdr new_list))
;; rename the tabs
(setq cnt (cond ((= suffix "Numbers") 0) (64)))
(foreach x new_list
(vla-put-name x
(strcat tab_name
(cond
((= suffix "Numbers")
(itoa (setq cnt (1+ cnt))))
((chr (setq cnt (1+ cnt))))
)))
)
(princ)
) ; defun
(prompt "\n*-* Rename Tab layouts Loaded, Enter re-name-layouts to run. *-*")
(princ)
CAB,
This is really cool! Here is a question that I think can it can be done but I don't know where to start. Please just follow what it is saying.
Ok, lets start with a 4 tabs for sheets
in paper space. Lets say that you name the 4 tabs BFDS, BFDW, CFP01 and
CFP02.
Now take the shape (dwg area in model) of the view port from the tab BFDS and paste it into model space.
You want that shape (dwg area in model) to match the name of the tab. So you name the shape (dwg area in model) BFDS with text.
But I want to have that name of shape (dwg area in model) automatically
change with Rtext. So when you change that tab BFDS to BFINB.
The shape (dwg area in model) will automatically update to BFINB.
That is my question.
How would you do that with the rest of that tabs BFDW, CFP01 and CFP02? Is there a sequence diesel code for each tab?