TheMadCADer Posted April 10, 2015 Share Posted April 10, 2015 First off, Hello everybody. I'm a long, long, time guest, first time participant. Thanks for the many years of assistance, but I know have one I can not figure out. Now to my problem... We recently upgraded the plotter in our office and I created new named plot configs to work with the new plotter. I've successfully setup a LISP which automatically retrieves all named plot configs from a specific .dwt and updates or adds them to each drawing is opened. The part I'm have trouble with is getting rid of the old named plot configs. I've found routines that delete all, but I'm looking for one that deletes only ones with a certain printer name in the named config. ie. I want it to automatically delete the following configs: 24x36-OceTDS400 36x48-OceTDS400 11x17-RICOH 8.5x11-RICOH But leave the following alone: 24x36-hpT3500 36x48-hpT3500 11x17-LANIER 8.5-LANIER So, a routine that deletes all named configs with "OCE" or "RICOH" in them but leaves all others alone would do the job. I've looked around quite a bit today and did not find anything that works quite like this. If anybody has something similar or could point me in the right direction, I'd be greatly appreciative. Thanks Again! Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 10, 2015 Share Posted April 10, 2015 (edited) Welcome to CADTutor. In AcadDoc.lsp, add a function that iterates the ActiveDocument Object's PlotConfigurations Collection, deleting those that match... Posting from an iPhone, and going from memory here, so forgive any code errors Haha: (defun _DeletePlotConfigurations (acDoc) (vlax-for x (vla-get-plotconfigurations acDoc) (if (wcmatch (strcase (vla-get-name x)) "*OCE,*RICOH") (vla-delete x) ) ) ) (_DeletePlotConfigurations (vla-get-activedocument (vlax-get-acad-object))) ... That will handle getting rid of unwanted named Page Setups, but setting one as active will require something like this: http://forums.augi.com/showthread.php?80461-Page-Setup-Manager&p=1219546&viewfull=1#post1219546 (foreach layoutname (layoutlist) (vla-SetActivePageSetup layoutname “[color="red"]YourPageSetupName[/color]”) ) ... Both of which, will work with ObjectDBX. Cheers Edited April 11, 2015 by BlackBox Quote Link to comment Share on other sites More sharing options...
TheMadCADer Posted April 11, 2015 Author Share Posted April 11, 2015 Apparently I didn't look hard enough. Thank you BlackBox. I too am mobile at the moment, but this looks to be exactly what I need. Ill post here again once I test it out and let you know if you've solved my problem. Quote Link to comment Share on other sites More sharing options...
TheMadCADer Posted May 12, 2015 Author Share Posted May 12, 2015 BlackBox, Thank you for your help last month. The code you provided help me clean up our plotting environment quite a bit. Requests for my assistance with plotting have dropped substantially also. Thanks Again Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 12, 2015 Share Posted May 12, 2015 BlackBox, Thank you for your help last month. The code you provided help me clean up our plotting environment quite a bit. Requests for my assistance with plotting have dropped substantially also. Thanks Again You're welcome, TheMadCADer; I'm happy to help. Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.