Need help with iLogic Rule to Rename drawing sheets. to input parameters. Can someome help me automate this? the file has 3 sheets that I want to use an input parameter thats defined earlier in the iLogic program. For some reason today I just cant figure it out????
Steve
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Hi steve.markle,
Here is a quick example that gets an input from the user and applies it to the name of each sheet in the drawing.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'get input from user Dim sInput As String sInput = InputBox("Enter Sheet Name", "iLogic", "Page") 'iterate through the sheets Dim oSheet As Sheet For Each oSheet In ThisApplication.ActiveDocument.Sheets 'rename sheets oSheet.Name = sInput Next
Here's an alternate version that prompt the user for a unique name for each sheet:
'Interate through the sheets Dim oSheet As Sheet For Each oSheet In ThisApplication.ActiveDocument.Sheets 'get input from user Dim sInput As String sInput = InputBox("Enter Sheet Name", "iLogic", "Page") 'rename sheets oSheet.Name = sInput Next
I know this code is not right , but this is what im trying to do
'get input from userDim sInput1 As String sInput1 = WELDMENT_PART_NUMBER Dim sInput2 As String sInput2 = BLADE_BLANK_NUMBER Dim sInput3 As String sInput3 = HUB_PART_NUMBER 'iterate through the sheetsDim oSheet As Sheet For Each oSheet In ThisApplication.ActiveDocument.Sheets 'rename sheets oSheet.Name = sInput1 Next osheet oSheet.Name = sInput2 Next osheet oSheet.Name = sInput3
Thanks so much for your help!!!
Steve
Hi steve.markle,
There might be a more concise way to do this, but this example should work for you.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim sInput1 As String
sInput1 = "Cover Sheet"
Dim sInput2 As String
sInput2 = "General Arangement"
Dim sInput3 As String
sInput3 = "Details"
Dim lPos As Long
Dim lLen As Long
Dim sShName As String
Dim sShNum As String
Dim oSheet As Sheet
For Each oSheet In ThisApplication.ActiveDocument.Sheets
lPos = InStr(oSheet.Name, ":") 'position of the colon
lLen = Len(oSheet.Name) 'length of sheet name
sShName = Left(oSheet.Name, lPos -1) 'string left of the colon
sShNum = Right(oSheet.Name, lLen -lPos ) 'string right of the colon
If sShNum = 1 Then
oSheet.Name = sInput1
ElseIf sShNum = 2 Then
oSheet.Name = sInput2
ElseIf sShNum = 3 Then
oSheet.Name = sInput3
End If
Next