Results 1 to 6 of 6

Thread: LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

  1. #1
    I could stop if I wanted to
    Join Date
    2005-08
    Posts
    378
    Login to Give a bone
    0

    Cool LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

    Guys,
    Does anyone have a LISP Routine to erase all the paperspace tabs and layouts on a drawing ? If so could i get a copy, please ?

    Stephen

  2. #2
    100 Club CADmium's Avatar
    Join Date
    2004-08
    Location
    Eberswalde, Germany, Europe
    Posts
    128
    Login to Give a bone
    0

    Default Re: LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

    (vl-load-com)
    (vlax-for LAYOUT (vla-get-layouts(vla-get-activedocument(vlax-get-acad-object)))
    (vl-catch-all-apply 'vla-delete (list LAYOUT))
    )

    ,but one Paperspacelayout (the last active) cannot deleted

  3. #3
    I could stop if I wanted to
    Join Date
    2005-08
    Posts
    378
    Login to Give a bone
    0

    Cool Re: LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

    Thanks Thomas.

  4. #4
    I could stop if I wanted to
    Join Date
    2005-08
    Posts
    378
    Login to Give a bone
    0

    Cool Re: LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

    Thomas,
    Do you know if or how to rename the last active paperspace tab left ?
    I can have it erase everything on that tab though would like to be able to rename it back to paperspace.

    Stephen

  5. #5
    100 Club CADmium's Avatar
    Join Date
    2004-08
    Location
    Eberswalde, Germany, Europe
    Posts
    128
    Login to Give a bone
    0

    Default Re: LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

    Try this

    Code:
    (vlax-for LAYOUT (vla-get-layouts(vla-get-activedocument(vlax-get-acad-object)))
      (cond
        ((>(vla-get-taborder LAYOUT)1)
          (vl-catch-all-apply 'vla-delete (list LAYOUT))
        ) 
        ((=(vla-get-taborder LAYOUT)1)
          (not(vl-catch-all-error-p (vl-catch-all-apply 'vla-put-name(list LAYOUT "PAPER"))))
        )
      )  
    )

  6. #6
    I could stop if I wanted to
    Join Date
    2005-08
    Posts
    378
    Login to Give a bone
    0

    Cool Re: LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS

    Thanks alot Thomas, that has made the task of preparing drawings a little easier.

    Stephen

Similar Threads

  1. Replies: 9
    Last Post: 2013-04-12, 10:06 PM
  2. Lisp Routine for Layouts
    By derick.bonifacio in forum AutoCAD General
    Replies: 10
    Last Post: 2009-12-17, 07:31 AM
  3. Lisp Routine for Layouts
    By derick.bonifacio in forum AutoLISP
    Replies: 0
    Last Post: 2009-12-15, 08:29 PM
  4. Replies: 22
    Last Post: 2007-07-31, 10:29 AM
  5. VBA\LISP routine to switch layouts
    By emillerd in forum VBA/COM Interop
    Replies: 4
    Last Post: 2007-03-12, 01:40 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
  •