BIGAL Posted March 29, 2012 Share Posted March 29, 2012 I have no problems acessing the layout tabs just need help deleting a particular layout tab by its name. (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ) (setq plottablist (acad_strlsort plotabs)) (setq len (length plottablist)) (setq x 0) (repeat len (setq name (nth x plottablist)) (if (= name "layout to be deleted") delete tab ? Quote Link to comment Share on other sites More sharing options...
pBe Posted March 30, 2012 Share Posted March 30, 2012 (defun DelLay (name ) (foreach nm (layoutlist) (if (eq nm name) (vla-delete (vla-item (vla-get-layouts (vla-get-ActiveDocument (vlax-get-acad-object))) nm)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2012 Share Posted March 30, 2012 Another, supply with Document Object: (defun DeleteLayout ( doc name / item ) (if (not (vl-catch-all-error-p (setq item (vl-catch-all-apply 'vla-item (list (vla-get-layouts doc) name)) ) ) ) (not (vla-delete item)) ) ) e.g.: (DeleteLayout (vla-get-activedocument (vlax-get-acad-object)) "Layout1") Returns T if Layout is deleted, otherwise nil if Layout is not found. 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks PBe & Lee we have some third party software that always creates a temporary layout. autoplotting plots it as well. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 3, 2012 Share Posted April 3, 2012 You're welcome BIGAL; any questions about the code, just ask Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 4, 2012 Author Share Posted April 4, 2012 The code is fine we have a Plotting for Dummy's system here just makes it easier not to have to delete any unwanted plotted layouts. The rest is written in VL so doc is already called. will paste in prior to creating plot list. Quote Link to comment Share on other sites More sharing options...
pBe Posted April 4, 2012 Share Posted April 4, 2012 The code is fine we have a Plotting for Dummy's system here just makes it easier not to have to delete any unwanted plotted layouts. The rest is written in VL so doc is already called. will paste in prior to creating plot list. Deos you PfD generate a random layout names? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 4, 2012 Author Share Posted April 4, 2012 No Layout is always a fixed name thanks Pbe for asking trying out my Television at moment for screen but unfortunately still need glasses to see keyboard. Wish I had learnt to rouuchh ype prroperrly. Quote Link to comment Share on other sites More sharing options...
pBe Posted April 4, 2012 Share Posted April 4, 2012 Wish I had learnt to rouuchh ype prroperrly. Curious is all.. Cheers Bigal Quote Link to comment Share on other sites More sharing options...
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.