Jump to content

Recommended Posts

Posted

I have been searching this morning and only find examples on how to delete all layout tabs (except Model). I have two layout tabs which depending on the user's staus either need to be left in or deleted. I'm trying to delete just these two layout tabs but would rather not have to loop through all of them and use boolean to delete only these two. Isn't there a more direct way to say just delete a layout tab called BOM8x11.

Posted (edited)

(if
 (member "BOM8x11" (layoutlist))
  (vla-delete
    (vla-item
      (vla-get-layouts
        (vla-get-activedocument
          (vlax-get-acad-object)
          )
        )
      "BOM8x11"
      )
    )
  )

 

or

(if (not (vl-catch-all-error-p (setq vp (vl-catch-all-apply
                       'vla-item
                       (list (vla-get-layouts (vla-get-activedocument
                             (vlax-get-acad-object))) "BOM8X11"
                         )))))
 	(vla-delete vp))

 

or

(command "_.layout" "Delete" "BOM8X11")

Edited by pBe
Posted

Works like a champ. Many thanks.

Posted

found this somewhere on the net..

cant remember where sorry but its working

 

 
(defun c:deltab ()
(setq *doc (cond (*doc)
((vla-get-ActiveDocument
(vlax-get-acad-object)))))
(vlax-for lay (vla-get-layouts *doc)
(if (not (eq "MODEL" (strcase (vla-get-Name lay))))
(vla-delete lay)))
(print "All Tabs Deleted, Layout1 Tab is restored by default")
(princ
))

(princ "\nDELTAB Loaded.  Type DELTAB to Start.")

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...