;Written by Chris Wade - cmwade77 at http://theswamp.org
;If file dialog boxes appear, unremark the (setvar "filedia" x) lines
(defun c:ExportAllTabs (/ Mode)
; (setvar "filedia" 0)
(foreach pair (dictsearch (namedobjdict) "ACAD_LAYOUT")
(if (= 3 (car pair))
(progn
(if (/= (strcase (cdr pair)) "MODEL")
(progn
(vl-cmdf "._layout" "set" (cdr pair))
(vl-cmdf "._explortlayout" "")
)
)
)
)
)
; (setvar "filedia" 1)
)
Did you try this?
http://www.theswamp.org/index.php?topic=19721.msg240368#msg240368
My suggestion is to utilize the built in export layout command.
NOTE: This will export each layout to paper space and saves the file in the same folder as the drawing.Code: [Select];Written by Chris Wade - cmwade77 at http://theswamp.org
;If file dialog boxes appear, unremark the (setvar "filedia" x) lines
(defun c:ExportAllTabs (/ Mode)
; (setvar "filedia" 0)
(foreach pair (dictsearch (namedobjdict) ""ACAD_LAYOUT"")
(if (= 3 (car pair))
(progn
(if (/= (strcase (cdr pair)) ""MODEL"")
(progn
(vl-cmdf "._layout" "set" (cdr pair))
(vl-cmdf "._explortlayout" "")
)
)
)
)
)
; (setvar "filedia" 1)
)
So find the error....Really ? At least try to help a little bit.
I have made list file which deletes all objects in MODEL space which are not present in any of the viewports. Please see if it works for you.
Also I have used various custom functions made by other people and I thank them for the same. I have mentioned the source of the same.Code - Auto/Visual Lisp: [Select]
) ) ) ) ) ) ) ) ) ;;; Union of two selection sets ;;; Source : http://www.theswamp.org/index.php?topic=46652.0 ) ) ss ) ;; Subtracts one selection set from another and returns their difference ;; NOT optimal because it changes the previous/last selection set. ;;; Source : http://www.theswamp.org/index.php?topic=46652.0 ) ss ) ;;; Source : http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Auto-Update-of-XY-coord-in-Model-Space-onto-Paper-Space-Layout/td-p/4591789/page/2 ) ) ) ) ;; Matrix Transpose - Doug Wilson ;; Args: m - nxn matrix ;; Matrix x Matrix - Vladimir Nesterovsky ;; Args: m,n - nxn matrices ;; Matrix x Vector - Vladimir Nesterovsky ;; Args: m - nxn matrix, v - vector in R^n ;; Vector x Scalar - Lee Mac ;; Args: v - vector in R^n, s - real scalar
It works like a charm. Could you add more feature like separate layouts as the drawing?? Thank you. Anyway, this Lisp help me save time too much :)
It works like a charm. Could you add more feature like separate layouts as the drawing?? Thank you. Anyway, this Lisp help me save time too much :)
I am happy that I could help you.
For separate layouts as drawings, you can use the LISP given by cmwade.
I know that LISP but if I use that LISP first, I will open one by one drawing and use your LISP again. I meant that if I can separate layout and delete objects not on any viewport at the same time? Thank you very much
Edit: I found that if I only have object in viewport, running LISP again, and it will delete all objects viewpoint. Say another way, if I run the LISP 2 times, it will delete all objects on model space. Could you revise this? Thank you @mailmaverick
You need to first run my LISP to delete all objects which are not in any viewport. Then you should seperate each layout as drawing.
If I run this LISP 2 times, it will not delete all objects in Model Space but delete all those objects which are not included in any viewport. If you have already exported your viewports as seperate layouts and no viewports exist, then probably, all objects in Model Space would be deleted.
(vl-cmdf "._explortlayout" "")