
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use the following code to copy, renumber (rename), and sort the tabs in the correct order. However, I'm looking to automate our operations even more by using a diesel expression in the layout to reference the first 3 characters of the drawing name (typically a number 100, 101, 102, etc...). When we open our drawings we have to rename the first layout in order to get the following code to work.
The steps the code takes to create the copies is critical for Sheet Set Manager. I'm just not versed enough to figure out the code for the tab order.
(defun c:cnl (/ a adoc curpos curtab i n)
(and (= 0 (getvar 'tilemode))
(setq i (getint "\nEnter begining integer for suffix: ")
curtab (substr (getvar 'ctab) 1 (- (strlen (getvar 'ctab)) 2))
n (getint "\nHow many copies of this tab: "))
(repeat n
(command "._layout" "_copy" "" (strcat curtab (if (= 1 (strlen (setq a (itoa i))))
(strcat "0" a)
a)))
(setq i (1+ i))))
while
(setq ctr (1+ (length (layoutlist)))
adoc (vla-get-activedocument (vlax-get-acad-object))
lst (vl-sort (cdr (vlax-for i (setq lays (vla-get-layouts adoc)) (setq lst (cons (read (vla-get-name i)) lst)))) '>))
(while lst
(vla-put-taborder (vla-item lays (rtos (car lst) 2 2))
(setq lst (cdr lst)
ctr (1- ctr))))
)
Any help with this would be extremely appreciated!
Solved! Go to Solution.