hi all, whom of the many readers of this forum has a lisp that delete multiple named vieport in model space at once? share please.
many thanks!
Gee
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
This ?
(defun c:Test (/ v) (while (setq v (tblnext "VIEW" (null v))) (if (eq (cdr (assoc 70 v)) 0) (vla-delete (vla-item (vla-get-views (vla-get-ActiveDocument (vlax-get-acad-object)) ) (cdr (assoc 2 v)) ) ) ) ) (princ) )(vl-load-com)
Maybe something along the lines of:
(defun c:dvp ( ) (vlax-map-collection (vla-get-viewports (vla-get-activedocument (vlax-get-acad-object))) 'vla-delete ) (princ) ) (vl-load-com) (princ)
@EgoonS wrote:
... a lisp that delete multiple named vieport in model space at once? ....
Another way, if you're looking to get rid of all named model-space Viewport configurations:
(command "_.model" "_.vports" "_delete" "*" "" "_single")
You could stop with the "*" if you don't mind being left in whatever Viewport configuration you're in at the time, even if it no longer has a name.
But if by "multiple" you don't necessarily mean all, you can do this if you know the names, with a comma-separated list of them:
(command "_.model" "_.vports" "_delete" "VPName2,VPName3,VPName8")
You're welcome EgoonS - glad it helps.
@EgoonS wrote:
HI Thalwart, thanks for your effort..i'd tried but it doesn't work. im using acad2012 that maybe the case?
TiA
I am sorry , I thought that you want to delete views that are in Model space only whilst you need to delete viewports .
Can't find what you're looking for? Ask the community or share your knowledge.