Results 1 to 8 of 8

Thread: Lisp routine for multiple paper space layout tabs

  1. #1
    Member
    Join Date
    2013-11
    Posts
    3
    Login to Give a bone
    0

    Default Lisp routine for multiple paper space layout tabs

    I was curious to know if anyone knows of a LISP routine that can create multiple paper space layout tabs and can name them incrementally. Your help is greatly appreciated.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    Welcome to AUGI!

    This should get you started (case-sensitive):

    Code:
    (vl-load-com)
    
    (defun c:LAYOUT+ (/ *error* prefix i n acDoc oLayouts layoutName)
    
      (defun *error* (msg)
        (if acDoc
          (vla-endundomark acDoc)
        )
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (if
        (and
          (setq prefix (getstring "\nEnter layout name prefix: "))
          (setq i (getint "\nEnter starting index number: "))
          (setq n (getint "\nEnter ending index number: "))
          (< i n)
          (princ "\nWorking, please wait... ")
          (princ)
        )
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
           )
           (setq oLayouts (vla-get-layouts acDoc))
           (setq i (1- i))
           (while (< i n)
             (setq layoutName (strcat prefix (itoa (setq i (1+ i)))))
             (if (not (vl-position layoutName (layoutlist)))
               (progn
                 (princ (strcat "\nCreating layout \"" layoutName "\"... "))
                 (princ)
                 (vla-add oLayouts layoutName)
                 (princ "Done. ")
               )
               (progn
                 (princ
                   (strcat "\nLayout \"" layoutName "\" already exists. ")
                 )
                 (princ)
               )
             )
           )
         )
         (cond
           (n (prompt "\n** Invalid indexes entered ** "))
           (i (prompt "\n** Must enter an ending index ** "))
           (prefix (prompt "\n** Must enter a starting index ** "))
         )
      )
      (*error* nil)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    Also, I've moved this thread to the LISP forum.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  4. #4
    Member
    Join Date
    2013-11
    Posts
    3
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    The Lisp worked perfect. However I should have been more specific as far as content. I have a template set up and I wanted to copy the content on let's just say tab2 10 more times and name them incrementally. This would have worked perfect if it could have copied the content included in the layout from tab2 to be specific.

  5. #5
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    @BB
    If the user pressed ENTER with the function GETSTRING it would return an empty string "" which means a value to AND function

  6. #6
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    Quote Originally Posted by Tharwat View Post
    @BB
    If the user pressed ENTER with the function GETSTRING it would return an empty string "" which means a value to AND function
    ... And then?





    augi.layout+.png
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  7. #7
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    Quote Originally Posted by BlackBox View Post
    ... And then?
    Then you targeted two birds with one shoot
    Last edited by Tharwat; 2013-11-27 at 11:19 AM. Reason: one typo corrected

  8. #8
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Lisp routine for multiple paper space layout tabs

    Quote Originally Posted by Tharwat View Post
    Then you targeted two birds with one shut
    Cheers, Tharwat *tips hat*
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. 2015: Copy tabs in paper space
    By kberger668565 in forum AutoCAD General
    Replies: 3
    Last Post: 2014-09-23, 01:21 PM
  2. 2012: Paper space Tabs Not Showing Up in One Drawing
    By sovby254640 in forum AutoCAD General
    Replies: 6
    Last Post: 2013-10-24, 02:07 AM
  3. Replies: 2
    Last Post: 2010-02-17, 06:44 AM
  4. Plot all paper space tabs
    By gfreddog in forum AutoCAD General
    Replies: 3
    Last Post: 2008-03-18, 07:52 PM
  5. LISP routine to create PLT files from Layout tabs
    By Matt Mercer in forum AutoLISP
    Replies: 3
    Last Post: 2007-01-25, 02:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •