Strydaris Posted March 10 Posted March 10 Hey everyone, I have been searching around but cant seem to find an answer to this.... Is there a way to pull a list of page setups in a drawing? Essentially I was wondering if you can make your own list that would be the same list you get from the page setup manager. Thanks, Quote
GLAVCVS Posted March 10 Posted March 10 Hi This isn't something I usually work on, but I don't think there is a function in lisp that returns all the information you want. You probably need to do it step by step. There is some sample code on the AutoDesk page that should help you with what you want. https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-D36B145F-2855-4CBB-9BF6-A0BA66BE8A36 (vl-load-com) (defun c:Example_GetPlotStyleTableNames() ;; This example gets the current plot device information ;; and then displays the list of plot device names, ;; media names, localized media names, and plot style ;; table entries. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq Layout (vla-get-Layout (vla-get-ModelSpace doc))) ;; Refresh the current plot information for ;; this session. (vla-RefreshPlotDeviceInfo Layout) ;; List all the valid device names for the system (setq plotDevices (vlax-variant-value (vla-GetPlotDeviceNames Layout))) (setq x 0) (while (>= (vlax-safearray-get-u-bound plotDevices 1) x) (alert (vlax-safearray-get-element plotDevices x)) (setq x (1+ x)) ) ;; List all the media names, and their localized version (setq mediaNames (vlax-variant-value (vla-GetCanonicalMediaNames Layout))) (setq x 0) (while (>= (vlax-safearray-get-u-bound mediaNames 1) x) (alert (vlax-safearray-get-element mediaNames x)) (alert (vla-GetLocaleMediaName Layout (vlax-safearray-get-element mediaNames x))) (setq x (1+ x)) ) ;; List all the entries in the plot style table (setq styleNames (vlax-variant-value (vla-GetPlotStyleTableNames Layout))) (setq x 0) (while (>= (vlax-safearray-get-u-bound styleNames 1) x) (alert (vlax-safearray-get-element styleNames x)) (setq x (1+ x)) ) ) Quote
ronjonp Posted March 10 Posted March 10 @Strydaris Maybe this? (vlax-for x (vla-get-plotconfigurations (vla-get-activedocument (vlax-get-acad-object))) (print (vla-get-name x)) ) Quote
BIGAL Posted March 10 Posted March 10 is there a reason why you need the page setups ? We used custom lisp that were set up for each device so would plot correct every time. Even down to a multi story building version which looked at user name and sent plots to printer on their floor. Quote
Strydaris Posted March 10 Author Posted March 10 @BIGAL honestly I don't need this but someone in my office went online and found a lisp that sets a page setup as the default for each layout so they don't have to do it in the batch plot each time. For you lisp you have to know and enter the page setup name manually. They asked me if there was a way to show all the page setups so they can just select the one they want. Quote
ronjonp Posted March 10 Posted March 10 @Strydaris https://www.theswamp.org/index.php?topic=38005.0 Quote
Strydaris Posted March 11 Author Posted March 11 @ronjonp haha funny how that is exactly what I am looking for but only 14 years later. Thanks man. Quote
ronjonp Posted March 11 Posted March 11 2 hours ago, Strydaris said: @ronjonp haha funny how that is exactly what I am looking for but only 14 years later. Thanks man. Quote
BIGAL Posted March 11 Posted March 11 How many page setups do you use ? In @ronjonp code you get a list of the setups you could copy paste them out into say notepad and remove all the ones you do not use so have a hard coded list that is way shorter. We only had like 5. Quote
Strydaris Posted March 11 Author Posted March 11 @BIGAL I am trying to keep things to a minimum here but some of our older drawings get brought forward and those were from a time that we like to call the wild west here at the office. They have pagesetups for 3 different printers, PDFs, 8.5x14, 11x17, 18x24, 24x36. Its really a bit of a mess. I have seen 10 different page setups in a drawing before because when someone new works on something they feel the need to add another page setup. The idea on this is to make the printing of older projects for review before updating, easier. Quote
BIGAL Posted March 11 Posted March 11 Again we used a POP menu with the correct page setup hard coded into the lisp. This has 5 different page setups. We did not use Publish. Our Title blocks were set and we always plotted from a Layout with the titleblock at 1:1 scale using viewports ie A1 or for you a 24x36. Quote
ronjonp Posted March 12 Posted March 12 4 hours ago, BIGAL said: Again we used a POP menu with the correct page setup hard coded into the lisp. This has 5 different page setups. We did not use Publish. Our Title blocks were set and we always plotted from a Layout with the titleblock at 1:1 scale using viewports ie A1 or for you a 24x36. I know you mean well but there are better ways to do things 20+ years later. Especially with plotting. Quote
BIGAL Posted March 12 Posted March 12 @ronjonp We generally only had 1 dwg per project and used layouts, never model so pick plotter type and watch the sheets come out no more the end user has to think of. Yes I do have code for a mixture of title sheets in layouts, say landscape and portrait, again just pick one button and sheets are produced correctly. Biggest one for me was 88 layouts. A land development project. If we had multiple dwgs then sheet sets and publish would be the way to go so agree with you. Just a comment found publish at times to fail it would just screw up a layout plot and we could never find what caused it, the plot lisp worked perfect. It was like 60 Layouts of standard dwg's so then made into one PDF. I was in charge of 8 + plus other users for support so they were all happy pick a button and get on with next task. As I commented earlier plots went to correct printer on a floor in a multi story building based on a user name, not sure how you would add that to choose a plotstyle without adding more multiple choices. Quote
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.