AutoLISP: Purge Page Setups

The code posted below will purge all Page Setups except for the current page setup (if one is applied).
If you have ever received a drawing with many page setups this routine will help reduce the amount of setups that you have to navigate.

Here’s how:

;;  Function to delete all user plot set ups
;; Posted by; CAB @
(defun c:Del_Pagesetups (/ curdwg pslayout x) 
    curdwg   (vla-get-ActiveDocument (vlax-get-Acad-Object)) 
    pslayout (vla-get-Layout (vla-get-PaperSpace curdwg)) 
  ) ;_ end of setq 
  ;; Call RefreshPlotDeviceInfo before GetPlotDeviceNames 
  (vla-RefreshPlotDeviceInfo pslayout) 
  (vlax-for x (vla-get-Plotconfigurations curdwg) 
    (vla-delete x) 
  ) ;_ end of vlax-for 
)               ; End Plot_config_list 

About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in AutoLISP, AutoLISP: Manage, AutoLISP: Modify, Manage, Printing - Plotting, Uncategorized. Bookmark the permalink.

3 Responses to AutoLISP: Purge Page Setups

  1. Madhusudan Banerjee says:

    Dear Sir, I am a follower of your post. Thank you from me and others who share your knowledge and expertise. I have question i.e. how can I edit existing lisp routine? here existing not the one you or I make. I mean to say routine that comes with the software such as fillet or mirror command.

    Best Regards

    Madhusudan Banerjee


    • AutoCAD Tips says:

      Unfortunately, you cant edit the default commands. They are buried within the program’s API. You’re best bet would be to use a lisp routine that is a modification that suits your needs and then make sure that it is loaded in each session of AutoCAD so that it can be used.

  2. Oh, That’s beautiful. Thank you

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s