Is it possible to get PageSetupNames from another drawing?

Discussion in 'AutoCAD' started by klaudiussen, Jun 23, 2004.

  1. klaudiussen

    klaudiussen Guest

    I know about the PSETUPIN command but is it possible to get PageSetupNames from another drawing (not open) and put their names in a variable in AutoLISP? ActiveX? Can someone point me in the right direction?

    Thanks in advance.
    Regards Freddy K.
     
    klaudiussen, Jun 23, 2004
    #1
  2. I use this to import my pagesetups from a template drawing. Just change the (2) paths to reflect your path to the template file you have created.

    ;;;Code by Nauman
    (defun c:pgin (/ done CMDST)
    (SETQ CMDST (GETVAR "CMDECHO"))
    ;;;Save SMDECHO STATUS
    (setvar "cmdecho" 0)
    (setq done T)
    (command "PSETUPIN" "f:/data/offstd/cad/proto/pagesetup.dwg" "*")
    ;;;Import all the Pagesetups
    (while (= (getvar "CMDNAMES") "PSETUPIN")
    (command "y" )
    (setq done nil)
    )
    ;;;end while
    (setvar "cmdecho" CMDST) ;;RESET CMDECHO Status
    (prompt "\nPageSetups have been imported from
    f:/data/offstd/cad/proto/pagesetup.dwg")
    )
    ;;;End routine
     
    Aaron Cunningham, Jun 23, 2004
    #2
  3. Yes, it is possible. You will have to use ObjectDBX
    to access the document, then iterate the plotconfiguration
    collection to get the names.

    Depending on what version of AutoCAD you are
    using the ObjectDBX syntax will vary slightly.

    Should be plenty of previous examples posted here
    to get you headed in the right direction


    --
    Autodesk Discussion Group Facilitator


    from another drawing (not open) and put their names in a variable in
    AutoLISP? ActiveX? Can someone point me in the right direction?
     
    Jason Piercey, Jun 23, 2004
    #3
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.