Over 1.081.000 registered users (EN+CZ). New 1D nesting and 3D nesting tools, updated Color converter. New AutoCAD 2025 commands and variables. Learn about twiGIS.
CAD tip # 11171:
Question
With help of the TotalLayouts reactor (or the PageOf utility, see below) you can add this possibility of multiple layout numbering to your AutoCAD and automate your batch plots.
TotalLayouts
To compose such automatic text, you will need two text fields - the current page/layout name/number and the total number of layouts (pages). The current layout name can be accessed through the variable CTAB so this field is available in Other > System variable: We will make the variable for the total number of layouts as an automatically updated LISP variable "totallayouts". This value will be then available in the Field dialog through Other > Lisp variable: But first you will need to define this variable and make sure it is dynamically updated whenever you add or delete a layout. This can be achieved with this simple LISP code: The code can be downloaded from Download. To load and run the code automatically in each DWG drawing session in your AutoCAD (or LT), add it to your Startup Suite in APPLOAD - drag the downloaded LSP file (stored in an AutoCAD support folder) onto the briefcase icon in the AppLoad dialog. Then compose the MText, Field or Attribute using the above mentioned variables.
PageOf
Another approach is used by the freeware LISP utility PageOf - see Download. This tool creates a field (text or block attribute) with an automatic counter "Page N of M" ("Seite N aus M"). The page number is generated from the order (position) of the individual layout tab. Just load the VLX file (APPLOAD), type the command PAGEOF and select a sample text object in paperspace of a layout (or a block attribute). The selected text is changed to the mentioned dynamic counter - e.g. "Page 2 of 5" for the second layout - and will change to "Page 2 of 6" if you add a new layout to the end of the layout list. This automatic counter then works also without any add-on utility or reactor.The option "Name" (since version 1.2) allows to bulk-rename layouts - either with keeping the original name (Layout1 of 10) or in the same way as the field (Page 1 of 10). When you add a new layout, just re-run the command.
You can preset the displayed text using the following LISP variables (in every session, i.e. e.g. in ACADDOC.LSP):
(setq _PageOfPage "Page ") ; "Seite "
(setq _PageOfOf " of ") ; " aus "
to display "Page 1 of 10" or "Seite 1 aus 10", or:
(setq _PageOfPage "")
(setq _PageOfOf "/")
to display just "1/10", or:
(setq _PageOfPage "Sheet ")
(setq _PageOfOf " (of ")
(setq _PageOfSuf ")")
to display "Sheet 1 (of 10)".