- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Goal:
-Have a rule that runs and Numbers pages to follow something like "ABC100, ABC101, ABC102, ABC103". I will manually change the "ABC" for each different drawing file.
Issues:
-I've tried using my very basic coding knowledge and some ChatGPT to attempt this for 2-3 hours with no avail. GPT's method is to have a prompted entry that it will change, and then increment the number. This has not worked for some reason I can't find/understand. I've checked 100 times, and I have a working and valid prompted entry that matches the name and pops up when I change pages. (code pasted below).
-There are times I add pages to the same drawings that I exclude from print/count for one-off asks from the welders, which I worry will get caught up in the rule (maybe as long as I keep them at the end, it won't matter). I was hoping to later make a Table of contents that I can insert manually on the title page. This "push it down" method will probably get caught in that created table (maybe have a condition that skips pages that have no title block active).
-I've thought about having a text block that is "ABC10<Sheet Number>" but at page 10, it would show "ABC1010" instead of "ABC110"
This is one of the many code blocks I've attempted to no avail.
Dim sheetPrefix As String = "ABC"
Dim startNumber As Integer = 100
Dim oDrawDoc As DrawingDocument = ThisDoc.Document
Dim sheetIndex As Integer = 0
For Each oSheet As Sheet In oDrawDoc.Sheets
Dim pageCode As String = sheetPrefix & (startNumber + sheetIndex).ToString
' Access the title block
Dim oTB As TitleBlock
oTB = oSheet.TitleBlock
' Try to update the "PAGE_CODE" text field
Try
oTB.SetPromptResultText("PAGE_CODE", pageCode)
Catch
MessageBox.Show("Field 'PAGE_CODE' not found in title block on sheet: " & oSheet.Name)
End Try
sheetIndex += 1
Next
I'm at a loss on why it's not working and frustrated that something this simple can't be done in Base Inventor (to my knowledge)
Thank you for any help
Solved! Go to Solution.