Iterate through all layout form left to right

Iterate through all layout form left to right

ninh.ht
Observer Observer
774 Views
4 Replies
Message 1 of 5

Iterate through all layout form left to right

ninh.ht
Observer
Observer

Hello everyone, now I want to rename all layouts begin 1 from left to right by using C#. Anyone can help me please! Thank you!

0 Likes
775 Views
4 Replies
Replies (4)
Message 2 of 5

_gile
Consultant
Consultant

Hi,

Order the layouts by their TabOrder property.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 5

ninh.ht
Observer
Observer

hello @_gile , i want to iterate all Layout tab name and add them to a Listbox then I will renumber them but normally, the listbox layout name isn't from left to right order. Look at the photo, I add 2 layouts (Layout1, Layout2) and listbox show form left to right, but when I move Layout 1 to the top, the listbox don't show form left to right

ninhht_0-1636965214718.png

ninhht_1-1636965243984.png

Thanks!

 

0 Likes
Message 4 of 5

_gile
Consultant
Consultant

I am not able to answer without knowing anything about your ListBox.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 5 of 5

BlackBox_
Advisor
Advisor

Duplicate thread: 

 

https://forums.augi.com/showthread.php?176212-Iterate-through-all-layout-and-rename-them-from-left-t...

 

 

Perhaps OrderBy() will help: 

 

layoutList.OrderBy(x => x.TabOrder).ToList();

 

 


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

0 Likes