YZ Posted June 21, 2011 Share Posted June 21, 2011 Is there a way to return the total number of layouts in a drawing file? I would use it to update a field showing the total number of sheets in a set. (eg 2 of "X", where X is the field variable). Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 21, 2011 Share Posted June 21, 2011 heres one way the variable Len is the number you require (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ) (setq len (length plotabs)) Quote Link to comment Share on other sites More sharing options...
YZ Posted June 21, 2011 Author Share Posted June 21, 2011 Thanks BIGAL. I do not think that I can use this solution because I am only using LT. Is that correct? If I break it down, does the code you provided extract a list of all the layout tab names and then count the number of items in that list? It looks unlikely therefore that I can get a simple variable in the Field dialog box. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 22, 2011 Share Posted June 22, 2011 Didnt see the LT not sure if you can get around it smae sort of thing how many layers in a drawing theres no variable saved with the total. Quote Link to comment Share on other sites More sharing options...
eric_monceaux Posted March 27, 2013 Share Posted March 27, 2013 Hey BIGAL, this is almost exactly what I need, however is their a way to have it subtract the MODEL tab or just less one? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 28, 2013 Share Posted March 28, 2013 Took me a while "len-1" 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.