Change Titleblock Number per page without using Prompted Entry

Change Titleblock Number per page without using Prompted Entry

C_Haines_ENG
Collaborator Collaborator
390 Views
6 Replies
Message 1 of 7

Change Titleblock Number per page without using Prompted Entry

C_Haines_ENG
Collaborator
Collaborator

I am trying to have each page have a semi unique number. Essentially I want the TitleBlock to include a number that will increase linearly per page but sometimes will duplicate. So: 1, 2, 3, 3, 4, 5, 5, etc.

 

I would like to achieve this without using prompted entry. 

0 Likes
Accepted solutions (1)
391 Views
6 Replies
Replies (6)
Message 2 of 7

dalton98
Collaborator
Collaborator
Accepted solution

I think your best bet would be the 'Sheet Revision Number'. You can add it to your title block under sheet properties.

Heres an example that checks if the previous sheet's drawing view matches the current sheet's

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim j As Integer = 1
On error resume next
For i = 1 To oDoc.Sheets.Count
	If oDoc.Sheets(i).DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument.DisplayName = _
	oDoc.Sheets(i - 1).DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
		oDoc.Sheets.Item(i).Revision = j
	Else
		j = j + 1
		oDoc.Sheets.Item(i).Revision = j
	End If
Next 

 

0 Likes
Message 3 of 7

C_Haines_ENG
Collaborator
Collaborator

I was also looking into using "Stock Number" because the attached model directly correlates to the model. However it seems like your code just re-writes all pages to revision 1. 

0 Likes
Message 4 of 7

dalton98
Collaborator
Collaborator

If it does that then it mean the first view on each sheet is the same as the previous sheet. I would need more info on what a duplicate sheet means.

Stock number is referenced to the part not the individual sheet, so that would be difficult to manage.

0 Likes
Message 5 of 7

C_Haines_ENG
Collaborator
Collaborator

A duplicate numbered sheet happens when the same model is on both Sheets.

 

For example if I have 3 parts, PART_A, PART_B, PART_C on the layout shown below

 

Sheet 1 - PART_A (Page REV 1)

Sheet 2 - PART_B (PAGE REV 2)

Sheet 3 - PART_B (PAGE REV 2)

Sheet 4 - PART_C (PAGE REV 3)

 

Is that possible to do?

 

0 Likes
Message 6 of 7

dalton98
Collaborator
Collaborator

Hmm thats what it does for me. Is the 'DisplayName' the same for each of your parts? Try changing 'DisplayName' to "FullFileName"

0 Likes
Message 7 of 7

C_Haines_ENG
Collaborator
Collaborator

There we go that works.

 

Thank you!

0 Likes