field of arrangement (order) of tab?

field of arrangement (order) of tab?

mohandis2
Advocate Advocate
682 Views
8 Replies
Message 1 of 9

field of arrangement (order) of tab?

mohandis2
Advocate
Advocate

ctab is a system variable of current tab, great.

Is there a similar variable that gives the arrangement (order) of the tab (tab position)?

for example:

1 for first tab

3 for 3rd tab

5 for 5th tab and so on.

if not, is there any work around (lisp)?  

 

Thanks.

 

0 Likes
683 Views
8 Replies
Replies (8)
Message 2 of 9

CodeDing
Advisor
Advisor

@mohandis2 ,

 

Here is the lisp to get what you're looking for:

(vlax-get-property (vla-get-ActiveLayout (vla-get-ActiveDocument (vlax-get-acad-object))) 'TabOrder)

 

Best,

~DD

0 Likes
Message 3 of 9

mohandis2
Advocate
Advocate

invalid field code

 

mohandis2_0-1723051642907.png

 

0 Likes
Message 4 of 9

pendean
Community Legend
Community Legend

@mohandis2 wrote:

invalid field code


I suspect that LISP code does not run in FIEILD's pop-up

pendean_0-1723053152065.png

 

Since you did ask

pendean_1-1723053192003.png

 

Are you needing it be an option only in that FIELD dialog box?

How many tabs do you have? Any reason you don't use SSM (SheetSet Manager) and it's tools to do what you seek instead?

0 Likes
Message 5 of 9

mohandis2
Advocate
Advocate

this filed will be an attribute in title block as Sheet# here (Sheet# of Nbr_of_Sheets)

I have about 20 sheets

I'm not using SSM because it is not being used in our office.

 

0 Likes
Message 6 of 9

CodeDing
Advisor
Advisor

I do not think there is a way to create a FIELD to accomplish what you're looking for...

 

UNLESS you rename your current tabs to their corresponding numbers (1, 2, 3, etc...)

0 Likes
Message 8 of 9

mohandis2
Advocate
Advocate

here is what we use to achieve that, if my sheet is D07_20

this field gives me the number 20

 

$(substr,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),1))

 

the only problem here is that I have to name my sheet with a suffix _20 manually, I want to automat it so that the number 20 varies and reflects the position of my sheet in the sheets list.

 

mohandis2_0-1723056083808.png

 

 

 

0 Likes
Message 9 of 9

Sea-Haven
Mentor
Mentor

An alternative method is you can do a "sheetnum of sheets", using a lisp to update say 2 Title block attributes, just run any time, can do suffix prefix etc. Lots of examples out there. Won't go into it now but can trigger when you do a close or save.

0 Likes