Need som starting guideance to offset page numbering on IDW sheets

Need som starting guideance to offset page numbering on IDW sheets

JDidrik
Contributor Contributor
678 Views
2 Replies
Message 1 of 3

Need som starting guideance to offset page numbering on IDW sheets

JDidrik
Contributor
Contributor

Hi,

 

Im not very experienced with programing, therefore I need some guidence to get started on a solution to a problem I have.

 

I need to overide the page number of my drawings sheets, normally Inventor starts at page 1, but my drawings (100 pages) shall be part of a larger document, and therefore I have to offset the pagenumbers. My drawings shall be page 20 -> in the document. I am thinking that the best  solution is to create a prompted entry in the  title block which by either iLogic or VBA is overwrited. I allready have an iLogic form which filles out most of my titleblock, so maybe I can add a field there which reflects what page number shall be on sheet 1. My code must also skip page numbering on all sheets which is exluded from print.

 

I would be very gratefull if someone could give me a hint on where to start to solve this problem 🙂

 

Jan Didrik   

0 Likes
Accepted solutions (1)
679 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

I think something like this might work for you. This is VBA.

 

Create a prompted entry textbox to title block. Prompted entry text to be "PageNumber".

 

 

Sub PageNumbers()

 

Dim oApp As Inventor.Application

Set oApp = ThisApplication

 

Dim oDrawingDoc As DrawingDocument

Set oDrawingDoc = oApp.ActiveDocument

 

Dim intPageNum As Integer

intPageNum = InputBox("Page number start:", "Page numbers")

 

Dim oSheet As Sheet

Dim oTitleBlock As TitleBlock

Dim strPromptedText As String

strPromptedText = "PageNumber" 'this is prompted entry test in the titleblock

 

Dim oTxtBox As TextBox

 

For Each oSheet In oDrawingDoc.Sheets

     If oSheet.ExcludeFromCount = False Or oSheet.ExcludeFromPrinting = False Then

        Set oTitleBlock = oSheet.TitleBlock

        For Each oTxtBox In oTitleBlock.Definition.Sketch.TextBoxes

             If oTxtBox.Text = strPromptedText Then

               Call oTitleBlock.SetPromptResultText(oTxtBox, intPageNum)

             End If

        Next

    intPageNum = intPageNum + 1

    End If

 

Next

 

End Sub

0 Likes
Message 3 of 3

JDidrik
Contributor
Contributor

Thanks!

 

I asked for some starting guideance and you gave me the solution 😄

 

Jan Didrik

0 Likes