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

Auto Number Sheets (in paperspace) based on layout tab position

2 REPLIES 2
Reply
Message 1 of 3
asilva_mad
309 Views, 2 Replies

Auto Number Sheets (in paperspace) based on layout tab position

I'm looking for a lisp that can be used to number the sheets/paperspaces automatically in the "sheet number" row at the title block (as displayed in the attached screenshots) according to the layout tab position, so that if I have 3 layouts, for example, the first one displays 1 in the sheet number row, the second: 2, and the third: 3. And if I add an additional layout between the first and second layouts, then the new layout displays 2 and the last layouts renumber automatically to: 3 and 4.

I've tried this one changing block name and field entry but it didn’t worked.

Also tried the "PageOf" utility (https://www.cadforum.cz/en/total-number-of-layouts-as-a-field-tip11171) but for that I would have to rename layouts by number and I want to keep the "A-1.00" format because I already have a field to add the layout tab name automatically to each title block.

Also tried Sheet Set Manager but in that option I also have to number the sheets one by one and they don't change if I add another layout tab.

2 REPLIES 2
Message 2 of 3
paullimapa
in reply to: asilva_mad

Message 3 of 3
Sea-Haven
in reply to: asilva_mad

In simple terms you get all your layouts details, loop through the layouts, then a simple check of (setq tabnum (vla-get-taborder lay)), you then just update the correct attribute in the title block, update the total sheets  as well at same time.

 

So if you have a title block what is its name and what is the name of the 2 attributes in the title block. Need that before any true code provided.

 

 

(setq lays  (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
(vlax-for lay lays
(if (= (vla-get-name lay) "Model")
(princ)
(progn
(setvar 'ctab (vla-get-name lay))
(princ (setq tabnum (vla-get-taborder lay)))
; do the update attribs here
)
)
)

 

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

Post to forums  

State of Sustainability Webinar


AutoCAD Inside the Factory