gazzalp Posted December 10, 2008 Share Posted December 10, 2008 Is there any way to get the layout tab name changed anytime you create a pdf? Anytime i create a pdf it calls the drawing "title (layout1)" i want it to be able to ask me to change the name of "layout" anytime i PDF so i can change it to the drawing revision number. IE Click Print to PDF, it has a dailog box asking for the revision, then the pdf is created called "title-A" (for a revision A). and next time i open the drawing instead of layout tab being called "layout" it will be "A" any help is appreciated Quote Link to comment Share on other sites More sharing options...
Dipali Posted December 10, 2008 Share Posted December 10, 2008 Can't you just rename the layout tabe name. select & right click Quote Link to comment Share on other sites More sharing options...
gazzalp Posted December 10, 2008 Author Share Posted December 10, 2008 sorry i should have made it clearer. I work for a company and we are always emplying new staff. we dont want people to have to think about renaming the layout tab everytime a drawing revision changes. so we want autocad to prompt us anytime we create a pdf, because ultimately thats when the layout tab will change. therefore with the click of one button (the pdf button) it will ask us to change the layout tab and will automatically rename our pdf file. With the way you have suggested we would have to first rename the layout tab then click on pdf, so it just adds another step, and means our new employees who arent used to it may forget to change the layout tab. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 10, 2008 Share Posted December 10, 2008 I know very well of your problem, gazzalp, as I too have had to deal with such an issue... We would sometimes just have users PDF the whole load of files and then some poor sod would have to go through all the filenames, taking out the (Layout 1) or (Model) at the end of the filename... I suppose you could use a reactor that would run off the back of the plot command, and run a LISP that would somehow change the layout tab name, but I am not too sure if or how this could be done - just a suggestion. Quote Link to comment Share on other sites More sharing options...
borgunit Posted December 10, 2008 Share Posted December 10, 2008 This may suffice for the first part. It only allows a single Layout tab though. Public Sub RenameLayoutTabToInputRevLetter() Dim sRev As String sRev = InputBox("Revision Level", "Get Revision Level", "A") '-------------------------------------- Dim acLayout As AcadLayout ''''''''''''''''''''''''''''''''''''''' If ThisDrawing.Layouts.Count > 2 Then Exit Sub For Each acLayout In ThisDrawing.Layouts Select Case acLayout.Name Case "Model" Case Else acLayout.Name = sRev End Select Next acLayout End Sub Quote Link to comment Share on other sites More sharing options...
gazzalp Posted December 10, 2008 Author Share Posted December 10, 2008 Thanks, although im not sure how to use that. Is it just a lisp routine that should be saved as normal (ie: save in notepad as.lsp) because i tried that but it didn't work. Quote Link to comment Share on other sites More sharing options...
matthewrussell Posted December 10, 2008 Share Posted December 10, 2008 No that is a VBA code. You will need to go into macros I think it is. It is under the tools menu Quote Link to comment Share on other sites More sharing options...
gazzalp Posted December 11, 2008 Author Share Posted December 11, 2008 Thanks, I got it to work but it doesnt exactly do what i want. I want to be able to do a PDF from the dwg, and it come up and ask me what the revision is, and accordingly change the name of the pdf to "title (revision)" as well as the layout tab to be the revision as well. And next time i open the drawing it should still have that revision instead of layout. Quote Link to comment Share on other sites More sharing options...
ML0940 Posted December 11, 2008 Share Posted December 11, 2008 You could likely do it on a plot event, in the acad.dvb file. ML Quote Link to comment Share on other sites More sharing options...
gazzalp Posted December 11, 2008 Author Share Posted December 11, 2008 Thanks, sorry to be a pain but how would i find/load/revise this? Quote Link to comment Share on other sites More sharing options...
mrharris78 Posted January 24, 2012 Share Posted January 24, 2012 I have 2 Lisp routines that I use for this; One takes the variable "DWGNAME" and sets this value as the layout tab name (truncated to exclude the .dwg). This only works for single layouts since you are using the DWGNAME variable and multiple layout tabs cannot have the same name. The other takes a specific attribute and sets the layout name to that attribute (In my case the "Revision" attribute). I include this lisp in my accodoc.lsp file, so when I publish multiple files (pdf) to single sheets it names them 'Filename-Revision' eg STMP0345-C It would be nice however to combine the two lisps into one to provide DWGNAME+ATTRIBUTE for the layout name... Harris Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 24, 2012 Share Posted January 24, 2012 Its pretty easy to get a list of the layout tab names then do a ssget of the title block plus this layout only then pull out attribute value and up date layout name. Heres a start (PROMPT ".....PRINTING DRAWING TO pdf's....") (setvar "cmddia" 0) (setvar "filedia" 0) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ) (setq plottablist (acad_strlsort plotabs)) (setq len (length plottablist)) (setq x 0) (repeat len (setq name (nth x plottablist)) (princ name) (if (/= name "Model") (progn (setvar "ctab" name) (COMMAND "-PLOT" "Y" "" "Cutepdf Writer" "A3" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Designlasercolour.ctb" "Y" "n" "n" "y" "N" "N" "y" ) ) ) (setq x (+ x 1)) ) (setvar "cmddia" 1) (setvar "filedia" 1) (princ) now ssget where is it (setq ss2 (ssget "x" '((0 . "INSERT")(2 . "Da1drsht")(410 . name)))) Probably use a vl-get & vl-put to change layout name others help please. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.