Placing multi-sheet PDFs into AutoCAD, semi-automatically
With regard to last week's post on modifying the PDF sheet display, I've taken another approach and come up with the following lisp code that will allow you to import some or all of the sheets of a multi-sheet PDF all at once. I realize that the built-in PDFATTACH command allows you to place multiple sheets at once, but you can't see the sheets as you place them. This lisp code is also more of a "how-to" for use in larger routines perhaps - and because such, this is raw lisp code with no error checking. Feel free to dress it up and append the header.
Load the lisp file and then type in the command PMP. Select a multi-sheet PDF file, and then enter the number of sheets you want to insert (this should be equal or less than the total number of sheets in the PDF). At this point you can start picking the lower left corner for each sheet until you reach the end.
I suspect there are some PDF libraries available by which you could expand this further, by detecting the number of sheets and maybe even the page size - which would allow for a fully automated tool to place multiple sheets.
;| R.K. McSwain, Copyright © 2012 - cadpanacea.com |; (defun C:PMP ( / fname cnt i) (setq fname (getfiled "\nSelect Multisheet PDF File" (getvar "dwgprefix") "PDF" 0)) (setq cnt (getint "\nNumber of sheets in this PDF to place ") i 1) (if fname (repeat cnt (vl-cmdf "-pdfattach" fname i (getpoint "\nPick LL point for next sheet ") 1.0 0.0) (setq i (1+ i)) ) ) (princ) )