AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Layout tab order

13 REPLIES 13
Reply
Message 1 of 14
jlawrence
2481 Views, 13 Replies

Layout tab order

Is there a way to quickly alphabetize the layout tabs? Or is there a drop down list to view/reorder all layout names? I know I can choose one or more layouts and move them, but we have so many that it's hard to find which tab we're looking for at a glance.

Thanks
13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: jlawrence

Give this a try.... (defun c:a2z_taborder (/ tabs tlist newlist) (setq tabs (vla-get-layouts *doc*)) (vlax-for tab tabs (if (not (= (strcase (vla-get-name tab)) "MODEL")) (setq tList (cons (vla-get-name tab) tList)) ) ) (setq newlist (acad_strlsort tlist)) (vlax-for tab tabs (if (not (= (strcase (vla-get-name tab)) "MODEL")) (vla-put-taborder tab (1+ (vl-position (vla-get-name tab) newlist))) ) ) ) -- Jeff check out www.cadvault.com "jlawrenc" wrote in message news:17517650.1097275514160.JavaMail.jive@jiveforum2.autodesk.com... > Is there a way to quickly alphabetize the layout tabs? Or is there a drop > down list to view/reorder all layout names? I know I can choose one or > more layouts and move them, but we have so many that it's hard to find > which tab we're looking for at a glance. > > Thanks
Message 3 of 14
Anonymous
in reply to: jlawrence

"jlawrenc" wrote in message news:17517650.1097275514160.JavaMail.jive@jiveforum2.autodesk.com... > Is there a way to quickly alphabetize the layout tabs? Or is there a drop down list to view/reorder all layout names? I know I can choose one or more layouts and move them, but we have so many that it's hard to find which tab we're looking for at a glance. This is a form with a ComboBox and a button. Works quite well for me. (I can post the dvb if you not familiar with VBA at all.) Private Sub cbtGoTo_Click() Dim sLay As String sLay = Me.cbxLayouts.Text ThisDrawing.ActiveLayout = ThisDrawing.Layouts(sLay) Me.Hide End Sub Private Sub UserForm_Initialize() Dim oLays As AcadLayouts, oLay As AcadLayout Dim vLays() As Variant, iTmp As Integer Set oLays = ThisDrawing.Layouts ReDim vLays(oLays.Count - 1) For iTmp = 0 To oLays.Count - 1 vLays(iTmp) = oLays.Item(iTmp).Name Next Me.cbxLayouts.List = vLays Me.cbxLayouts.Text = ThisDrawing.ActiveLayout.Name End Sub
Message 4 of 14
jlawrence
in reply to: jlawrence

Thanks, I'll give it a shot
:-)
Message 5 of 14
jlawrence
in reply to: jlawrence

hmmm... maybe i'm doing something wrong? this doesn't seem to do anything.
:-/
Message 6 of 14
Anonymous
in reply to: jlawrence

What did you do to determine that it's not doing anything? :-) Did you copy the code to a new file and save that file as a .lsp? Did you load that .lsp? Did you execute the command "a2z_taborder" ? If you did all of these, the tabs should be re-arranged alphabetically........although you may need to move the mouse over the screen for the window to update. Oops, I just noticed I forgot to change my global variable.........change the second line to this: (setq tabs (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))) -- Jeff check out www.cadvault.com "jlawrenc" wrote in message news:17938055.1097771246587.JavaMail.jive@jiveforum1.autodesk.com... > hmmm... maybe i'm doing something wrong? this doesn't seem to do anything. > 😕
Message 7 of 14
jlawrence
in reply to: jlawrence

thanks - i think i tried running "_taborder" instead of "a2z_taborder"
duh. i'll try again. thanks for your patience!
Message 8 of 14
jlawrence
in reply to: jlawrence

cool, i'll try this as well. would you post the dvb, tho? i'm not too familiear with VBA.

thank you!
Message 9 of 14
jlawrence
in reply to: jlawrence

yup, now it works! thanks again.
:-)
Message 10 of 14
Anonymous
in reply to: jlawrence

"jlawrenc" wrote in message news:25049496.1097875384602.JavaMail.jive@jiveforum2.autodesk.com... > cool, i'll try this as well. would you post the dvb, tho? i'm not too familiear with VBA. > > thank you! This doesn't sort them, but does provide an easier (IMO, at least) method of navigation. If you want them sorted, adding a sort function shouldn't be too much trouble.
Message 11 of 14
jlawrence
in reply to: jlawrence

Thanks!
Message 12 of 14
grmichmush
in reply to: jlawrence

I know I'm a little late to the party on this one but,  I tried this on my computer looking for a solution for the boss.  It worked great on mine but then when boss man puts it on his it returns an error.  I followed the error with exactly what is in the lsp file. I placed the file in the autocad support folder.

Command: a2z_taborder
; error: no function definition: VLAX-GET-ACAD-OBJECT
Command:

(defun c:a2z_taborder (/ tabs tlist newlist) (setq tabs (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for tab tabs (if (not (= (strcase (vla-get-name tab)) "MODEL")) (setq tList (cons (vla-get-name tab) tList)) ) ) (setq newlist (acad_strlsort tlist)) (vlax-for tab tabs (if (not (= (strcase (vla-get-name tab)) "MODEL")) (vla-put-taborder tab (1+ (vl-position (vla-get-name tab) newlist))) ) ) )

Message 13 of 14
TerryDotson
in reply to: grmichmush

Try adding this at the beginning of the file.

 

(vl-load-com)

Message 14 of 14
grmichmush
in reply to: TerryDotson

SUCCESS!!! Thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report