Changing sheet to display in PDF Underlay
When you attach a multi-page PDF file as a reference in AutoCAD, you can choose which sheet to display (see below).
But what if you want to change that reference to a different sheet in the PDF file, later on? There is nothing in the Ribbon to do this, and "Page Number" is a read-only property in the Properties Palette. You could detach the reference and add it again with the new sheet number, but the following lisp function is quicker.
The lisp function below allows you to pick the PDF Underlay object on the screen, and then enter a new sheet number. The image on the screen is updated as soon as the command completes. Make sure you choose a valid sheet. If the PDF file contains 9 sheets and you enter 10, then the PDF reference will disappear.
The function is named "Foo" (feel free to rename) and it calls the PdfPage function.
;| R.K. McSwain, Copyright © 2011 - cadpanacea.com |; (defun PdfPage (ent pag / sel dat) (setq dat (entget (cdr (assoc 340 (entget ent))))) (entmod (subst (cons 2 pag) (assoc 2 dat) dat)) (entupd ent) ) (defun c:Foo ( / s n) (setq s (car (entsel))) (setq n (getstring "\nEnter new page: ")) (pdfpage s n) (princ) )
What else can you think of, to automate?