Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto page numbering

Status
Not open for further replies.

jeremywelch

Programmer
Aug 9, 2005
3
US
I work with schematics that are numerous pages long and i am trying to find a way to number each page accordingly with out having to change a text box on each page!

 
Todd,

thanks for the reply and sorry for not wording my question in an understandable matter!

I looked on both of those web sites and didn't find much that really helped me.

What i am trying to do is find a way to automatically number several layouts within a drawing. I get to drawing a schematic that can get up to 50 60 pages long and i am having to go through each layout and change the page number accordingly.

Is there a way to maybe use a routine that numbers each layout when i copy it. or maybe when i go to print it.

 
Hi Jeremy,

If I understand you right, each layout tab consitutes a unique page number right? If so just use the page layout collection count to number/renumber each sheet.

Code:
Dim objLOTabs As AcadLayouts
Dim intPgNo As Integer
  
Set objLOTabs = ThisDrawing.Layouts
  
For intPgNo = 1 To objLOTabs.Count
  ' ... number pages here ....
Next intPgNo

I would run the routine after you were done creating layouts but it shouldn't matter, as the routine can easily just renumber each sheet.

HTH
Todd
 
Todd,

Thank you for the code, just a few more questions!

My page numbers are in a mtext block in each layout, to my understanding the code you gave me moves from one tab to the next, but how do i store the mtext and change the number for the next layout?

Jeremy
 
Hi Jeremy,

As you walk each tab, you'll increment your counter, query for your mtext block and change it accordingly. I would just modify every single block, even though you mentioned you may have 50 to 60, your routine should have no still complete quickly enough you won't find it annoying. You might check out FAQ687-5762 on how to query easily for mtext objects in AutoCAD.

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top