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:
DEL_PAGESETUPS
~enjoy


;;  Function to delete all user plot set ups
;; Posted by; CAB @ http://forums.augi.com/showthread.php?63099-page-setup-import-vlisp
(defun c:Del_Pagesetups (/ curdwg pslayout x) 
  (vl-load-com) 
  (setq 
    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 these ads

About AutoCAD Tips

As weird as it sounds, AutoCAD is a hobby for me. But I am fortunate enough to have a career doing my hobby. I work for a large engineering firm supporting CAD users in various disciplines. My dream job would be to work for a company like Autodesk or Disney's Imagineering where inspiring others and using innovative approaches and software are adding value to projects and bringing design in all areas up to a new level. This blog serves as a repository or knowledge base for myself 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 experience better.
This entry was posted in AutoLISP, AutoLISP: Manage, AutoLISP: Modify, Manage, Printing - Plotting, Uncategorized. Bookmark the permalink.

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

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s