current pagesetup in status bar

Discussion in 'AutoCAD' started by The real JD, Feb 9, 2004.

  1. The real JD

    The real JD Guest

    Can someone offer a way to show the current pagesetup of a drawing at the
    statusbar? I searched and haven't found anything yet. TIA
     
    The real JD, Feb 9, 2004
    #1
  2. The real JD

    ECCAD Guest

    Suggestion:
    Get the current pagesetup (as a string called cur_pagesetup)
    then (setvar "MODEMACRO" cur_pagesetup)

    Bob
     
    ECCAD, Feb 9, 2004
    #2
  3. The real JD

    The real JD Guest

    Sorry not clear on something.
    is "cur_pagesetup" a system variable? Or are you suggesting to take the
    system variable and setq it to a string called cur_pagesetup ?
     
    The real JD, Feb 10, 2004
    #3
  4. The real JD

    The real JD Guest

    Okay, so i searched thru the system variables.
    How do i retrieve the name of the current pagesetup?
     
    The real JD, Feb 10, 2004
    #4
  5. The real JD

    ECCAD Guest

    I think something like:

    (setq adoc (vla-get-activedocument (vlax-get-acad-object))
    cur_pagesetup (vla-get-activelayout adoc)
    )

    Would set cur_pagesetup (string variable you can rename).
    Then:
    (setvar "MODEMACRO" cur_pagesetup)

    Above may not be the exact item (page setup) you want.

    Bob
     
    ECCAD, Feb 10, 2004
    #5
  6. Not sure if there is a direct route to the current
    pagesetup via ActiveX but this should do the
    trick for a vanilla version.

    Use like this:
    (getCurrentPagesetup (getvar "ctab"))

    ; [layout] - string, layout name
    ; returns current pagesetup of [layout] or nil
    (defun getCurrentPagesetup (layout / lst data)
    (setq lst (dictsearch (namedobjdict) "acad_layout"))
    (setq lst (dictsearch (cdar lst) layout))
    (setq lst (member '(100 . "AcDbPlotSettings") lst))
    (setq data (cadr lst))
    (if (and (= 1 (car data)) (/= "" (cdr data)) )
    (cdr (assoc 1 lst)) )
    )
     
    Jason Piercey, Feb 11, 2004
    #6
  7. The real JD

    The real JD Guest

    Thanks Jason!
    I'll give that a try... :)

     
    The real JD, Feb 11, 2004
    #7
  8. You're welcome!
     
    Jason Piercey, Feb 11, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.