CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 2605 

CAD tip CAD tip # 11171:

Question CAD 
 %  platform  category 
Q - question

Total number of layouts as a field.

A - answer AutoCAD does not offer the total number of layouts as a system variable so you cannot easily use automatic text fields of the type "Page X of Y" to your title blocks.

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.

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 To load and run the code automatically in each DWG drawing session in your AutoCAD, 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.

Another approach is used by the freeware utility PageOf - see This tool creates a field with an automatic counter "Page N of M" ("Seite N aus M"). 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" - 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.

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".

100% *  CAD 
15.11.2016    15597×   FAQ  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 11821:How to publish PDF sheets (pages) under the plain layout name?
Tip 9331:What is contextual field and why it is not updated in a block?
Tip 9147:Batch publishing to PDF uses different margins than single prints.
Tip 7585:Plotting/exporting a series of drawing frames composed in a DWG drawing (or creating layouts).
Tip 6672:I want to display my drawing the same way it is printed.

Back   All CAD Tips All CAD tips&tricks

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Export 3D VRML scenes from AutoCAD and Inventor
VRMLout More info

Please use these tips at your own risk.
CAD Studio is not responsible for possible problems that may occur as a result of using any of these tips.