@ad_sherratt wrote:
Hi pbejse,
However, if the desired result is actually achievable via a lisp routine, I'm all ears!
Sure you can achieve this via lisp. But it involves changing the layout tab names to:
14689-E-420 [A], 14689-E-421 [A], 14689-E-422 [A]
So when you use publish, it will take those names. You're good with that?
Here's a quick code that works on your sample drawing
(Defun c:DwgNumberAndRevToTab (/ aLayouts ss i AttData DwgNo RevNo)
(setq aLayouts (vla-get-layouts
(vla-get-ActiveDocument (vlax-get-acad-object))
)
)
(if (setq ss (ssget "_X"
'((0 . "INSERT") (2 . "TTLBLK_ATTS_A1H") (66 . 1))
)
)
(progn
(repeat (setq i (sslength ss))
(setq AttData
(mapcar
'(lambda (at)
(list (Vla-get-tagstring at)
(vla-get-textstring at)
)
)
(Vlax-invoke
(vlax-ename->vla-object
(setq e (ssname ss (setq i (1- i))))
)
'GetAttributes
)
)
)
(and (setq DwgNo (Cadr (assoc "DWG_NO" AttData)))
(setq RevNo (Cadr (assoc "REV_NO" AttData)))
(not (member (setq layTabName (strcat DwgNo " [" RevNo "]"))
(layoutlist)
)
)
(Vla-put-name
(Vla-item aLayouts (Cdr (assoc 410 (entget e))))
layTabName
)
)
)
)
)(princ)
)
Another option is, a program to change the pdf name to reflect the drawing number and latest revision based on a database like a drawing register or even your drawing schedule.
You can also try the @Sea-Haven suggested link on top of the code posted above to use the DWG_NO and REV_NO, you may need to modify this bit here with your specific settings.
(COMMAND "-PLOT" "Y" "" "dwg to Pdf"
"Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C"
"y" "Acad.ctb" "Y" "n" "n" "n" pdfName "N" "y"
)
The possibilites are endless
Or you can just go ahead with Maratovich has a very extensive plot routine. I'm sure its worth the greenbacks.
HTH