w64bit Posted August 5, 2022 Posted August 5, 2022 (edited) I am trying to delete the viewport on a layout containing only one viewport (and nothing else). Can anyone please help? Edited August 5, 2022 by w64bit Quote
ronjonp Posted August 5, 2022 Posted August 5, 2022 Try this .. does not check for locked layers: (defun c:foo (/ s) (foreach l (layoutlist) (and (setq s (ssget "_X" (list (cons 410 l)))) (= 2 (sslength s)) (setq s (mapcar 'cadr (ssnamex s))) (= "VIEWPORT" (cdr (assoc 0 (entget (car s)))) (cdr (assoc 0 (entget (cadr s))))) (mapcar 'vla-delete (mapcar 'vlax-ename->vla-object s)) ) ) (princ) ) 1 Quote
w64bit Posted August 5, 2022 Author Posted August 5, 2022 It's working very well. Thank you very much. Quote
ronjonp Posted August 5, 2022 Posted August 5, 2022 39 minutes ago, w64bit said: It's working very well. Thank you very much. Glad to help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.