Ilogic to Synchronize sheetnames

Ilogic to Synchronize sheetnames

Anonymous
Not applicable
553 Views
4 Replies
Message 1 of 5

Ilogic to Synchronize sheetnames

Anonymous
Not applicable

Hi

How to use ilogic or ? Want to Synchronize sheetname in browser with the sheetname on 2D..

Sheetname at 2D is created with promted Entry- but then users need to fill out everytime and we want a permanent naming.

example. sheet 1 is always named with: Main assembly

Sheet 2 is named with: Spare parts

Anyone who have a good solution for this? in a way were users cant rename the permanent naming in browser.

 

0 Likes
554 Views
4 Replies
Replies (4)
Message 2 of 5

mcgyvr
Consultant
Consultant

This is assuming your sheet name prompted entry is "<Sheet Name>" if its something else just change that in the code below

 

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument

Dim oTitleBlock As TitleBlock
Dim oTextBox As TextBox
Dim oSheet As Sheet

Dim lPos As Long
Dim sSheetName As String
Dim sNewName As String

For Each oSheet In oDoc.Sheets
    'check to see if the sheet has a titleblock instance
    If oSheet.TitleBlock Is Nothing Then
    'Do Nothing
    Else
        oTitleBlock = oSheet.TitleBlock
    For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes
                If oTextBox.Text = "<Sheet Name>" Then
                    'check to see if prompted entry is empty
                    If oTitleBlock.GetResultText(oTextBox) = "" Then
                    'if prompted entry is empty, then query the user
                    sNewName = InputBox("Enter Sheet Name", "No Sheet Name Found in TitleBlock", sSheetName)
                    oTitleBlock.SetPromptResultText(oTextBox, sNewName)
                    oSheet.Name = oTitleBlock.GetResultText(oTextBox)
            Else
            oSheet.Name = oTitleBlock.GetResultText(oTextBox)
            End If
        End If
        Next
        End If
Next
iLogicVb.UpdateWhenDone = True


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 5

Anonymous
Not applicable

Hi and thanks-we will try

 

0 Likes
Message 4 of 5

kelly.young
Autodesk Support
Autodesk Support

@Anonymous did the sweet code @mcgyvr wrote for you solve your issue?

 

Please select the Accept as Solution button if a post solves your issue or answers your question.

0 Likes
Message 5 of 5

Anonymous
Not applicable

Hi

 

Its working partly-the name from browser for each sheet is now visible in header of 2D, but when opening template we still get the promt and do now need to press cancel xx times for each sheet we have.

see attachment

template 2017 dok.pngPromt 2017.png

0 Likes