Jump to content

Delete Layout Tabs at once?


pmadhwal7

Recommended Posts

You can define a basic program such as:

(defun c:deltab ( )
    (vlax-map-collection (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
       '(lambda ( x ) (if (= :vlax-false (vla-get-modeltype x)) (vla-delete x)))
    )
    (princ)
)
(vl-load-com) (princ)

 

And then run the above across multiple drawings using an AutoCAD Script to open each drawing, load & run the AutoLISP program, and then save & close the drawing.

Link to comment
Share on other sites

1 hour ago, Lee Mac said:

You can define a basic program such as:


(defun c:deltab ( )
    (vlax-map-collection (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
       '(lambda ( x ) (if (= :vlax-false (vla-get-modeltype x)) (vla-delete x)))
    )
    (princ)
)
(vl-load-com) (princ)

 

And then run the above across multiple drawings using an AutoCAD Script to open each drawing, load & run the AutoLISP program, and then save & close the drawing.

Hey Lee .. why did you choose vlax-map-collection over vlax-for ?

Link to comment
Share on other sites

44 minutes ago, ronjonp said:

Hey Lee .. why did you choose vlax-map-collection over vlax-for ?

 

No particular reason, I just fancied a change 🙂

  • Like 1
Link to comment
Share on other sites

12 hours ago, Lee Mac said:

You can define a basic program such as:


(defun c:deltab ( )
    (vlax-map-collection (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
       '(lambda ( x ) (if (= :vlax-false (vla-get-modeltype x)) (vla-delete x)))
    )
    (princ)
)
(vl-load-com) (princ)

 

And then run the above across multiple drawings using an AutoCAD Script to open each drawing, load & run the AutoLISP program, and then save & close the drawing.

is there any way to delete those tab without opening dwg or run this script to multiple dwg in one go

Link to comment
Share on other sites

39 minutes ago, pmadhwal7 said:

is there any way to delete those tab without opening dwg or run this script to multiple dwg in one go

 

Yes - as noted in my post, you can create a script to open each drawing, load & run the AutoLISP program, and then save & close the drawing. Such a script could be created using my Script Writer application, or another batch-processing tool.

Link to comment
Share on other sites

"or another batch-processing tool."

 

Its a little more complicated but way faster Google Accoreconsole, Lee has provided the lisp, which must be loaded via a script. Just need to check for  VL support.

 

 

Link to comment
Share on other sites

In my opinion, the author does not read all the messages, only the last one 🙄
I previously gave lisp and solution for all files 😀

  • Like 1
Link to comment
Share on other sites

On 5/13/2021 at 3:17 PM, maratovich said:

In my opinion, the author does not read all the messages, only the last one 🙄
I previously gave lisp and solution for all files 😀

 

I agree - your AutoRunLisp application looks to be impressive & powerful @maratovich, congrats.

Link to comment
Share on other sites

On 5/13/2021 at 7:47 PM, maratovich said:

In my opinion, the author does not read all the messages, only the last one 🙄
I previously gave lisp and solution for all files 😀

i was try all the solution provided,and due to heavy work load i am unable to reply 😧

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...