There are two sections I changed to make the routine run successfully:
Section 1 - Commented out lines causing errors & replaced with new code:
;; Get attributes/vals from title blocks
; add this to initialize i value
(setq i 0)
;
(foreach lay (cdr (layoutlistordered)) ; this skips first layout tab
(if (setq ss (ssget "_X" (list (cons 0 "INSERT") (cons 2 "CBC-TITLE_A3LAYOUT") (cons 410 lay))))
;; sheetInfo = (layoutName description issue)
(setq e (ssname ss 0)
sheetInfo
(cons
(list
lay
(strcat
(getpropertyvalue e "SHEET-DETAILS")
" ("
; add space
" "
;
; (getpropertyvalue e "1") ; this does not exist
; (getpropertyvalue e "SHEET-NUMBER-OF-X1") ; for some reason this is always set to 1
; add this to get page #
(itoa (setq i (1+ i)))
;
" OF "
; (getpropertyvalue e "2") ; this does not exist
; (getpropertyvalue e "SHEET-NUMBER-OF-X2") ; for some reason this is always set to 1
; add this to get total pages not including first layout
(itoa (1- (length (cdr (layoutlistordered)))))
;
")"
);strcat
(getpropertyvalue e "ISSUE")
);list
sheetInfo
);cons
);setq
);if
(setq ss nil)
);foreach
Section 2 - Commented out the following 3 lines of code:
; (vla-SetTextStyle t_Style2 acTitleRow "ARIAL")
; (vla-SetTextStyle t_Style2 acHeaderRow "ARIAL")
; (vla-SetTextStyle t_Style2 acDataRow "ARIAL")
See attached revised files