Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
WIth this code, i get the drawing Sheet Name and place it in the titleblock.
This works very well, but I would like to tweak a little bit:
In the Titleblock, now appears something like:
"WhateverSheetName_A_:1"
"WhateverSheetName_B_:2"
:1, :2, :3 and so on are the automatic sheets numbering
But i'd like to remove it and show the sheetnames in the titleblock as:
"WhateverSheetName_A_"
"WhateverSheetName_B_"
Basically The goal is, to remove the last two digits from the Sheet Name
I created a new Variable: SheetNTrim as a string and tried to trim the last two digits. I tryied with Remove function, but i got syntax issues, can someone help me on this?
Thanks.
SyntaxEditor Code Snippet
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveDocument Dim oTitleBlockDef As TitleBlockDefinition
oTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item("My_TitleBlock") Dim oSheet As Sheet Dim oSheets As Sheets = oDrawDoc.Sheets For Each oSheet In oSheets ' Check to see if the sheet already has a title block and delete it if it does. If Not oSheet.TitleBlock Is Nothing Then oSheet.TitleBlock.Delete() End If ' This title block definition contains one prompted string input. An array ' must be input that contains the strings for the prompted strings. Dim sPromptStrings(0) As String 'start counting by 0 !!! sPromptStrings(0) = oSheet.Name ' Add an instance of the title block definition to the sheet. Dim oTitleBlock As TitleBlock
oTitleBlock = oSheet.AddTitleBlock(oTitleBlockDef, , sPromptStrings) Next
CCarreiras
Solved! Go to Solution.