Jump to content

Recommended Posts

Posted

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,

Posted

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))
    )
)

 

Posted

@Strydaris Maybe this?

(vlax-for x (vla-get-plotconfigurations (vla-get-activedocument (vlax-get-acad-object)))
  (print (vla-get-name x))
)

 

Posted

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.

Posted

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

Posted

@ronjonp haha funny how that is exactly what I am looking for but only 14 years later.

Thanks man. 

Posted
2 hours ago, Strydaris said:

@ronjonp haha funny how that is exactly what I am looking for but only 14 years later.

Thanks man. 

:beer:

Posted

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. 

 

 

Posted

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

Posted

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.

 

menu8.png.87aed6c8a46993749eca5c87f970b1cb.png

 

 

 

 

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

 

menu8.png.87aed6c8a46993749eca5c87f970b1cb.png

 

 

 

 

I know you mean well but there are better ways to do things 20+ years later. Especially with plotting.

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...