Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Layout tab order as they appear

3 REPLIES 3
Reply
Message 1 of 4
Shane731
210 Views, 3 Replies

Layout tab order as they appear

Hi everyone. I am currently try to find a way that will display all of my tabs in the order in which they appear. I used (layoutlist), but that only appears to list them in alphabetical order. For example, (layoutlist) lists my tabs in this order: ("Body" "Cutlist" "End"). The order they actually appear in is: "Cutlist" "Body" "End". Any ideas?
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Shane731

Try this one.
[code]
(defun GetLayoutList (Doc / LoList cnt tmpLo LoName)

(if (not Doc)
(setq Doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
)
(setq LoCol (vla-get-Layouts Doc))
(setq cnt 0)
(repeat (vla-get-Count LoCol)
(setq tmpLo (vla-item LoCol cnt))
(if (/= (setq LoName (vla-get-Name tmpLo)) "Model")
(setq LoList (cons (cons LoName (vla-get-TabOrder tmpLo)) LoList))
)
(setq cnt (1+ cnt))
)
(mapcar
'(lambda (x) (car x))
(vl-sort LoList '(lambda (a b) (< (cdr a) (cdr b))))
)
)
[/code]

--

Tim
"A blind man lets nothing block his vision."



wrote in message news:5152478@discussion.autodesk.com...
Hi everyone. I am currently try to find a way that will display all of my
tabs in the order in which they appear. I used (layoutlist), but that only
appears to list them in alphabetical order. For example, (layoutlist) lists
my tabs in this order: ("Body" "Cutlist" "End"). The order they actually
appear in is: "Cutlist" "Body" "End". Any ideas?
Message 3 of 4
Shane731
in reply to: Shane731

Thank you very much!! That did exactly what I wanted.
Message 4 of 4
Anonymous
in reply to: Shane731

You're welcome.

--

Tim
"A blind man lets nothing block his vision."



wrote in message news:5152573@discussion.autodesk.com...
Thank you very much!! That did exactly what I wanted.

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

Post to forums  

Autodesk Design & Make Report

”Boost