Need help with iLogic Rule to Rename drawing sheets. to input parameters

Need help with iLogic Rule to Rename drawing sheets. to input parameters

Anonymous
Not applicable
1,028 Views
5 Replies
Message 1 of 6

Need help with iLogic Rule to Rename drawing sheets. to input parameters

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
1,029 Views
5 Replies
Replies (5)
Message 2 of 6

Curtis_Waguespack
Consultant
Consultant

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

 

EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

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
0 Likes
Message 4 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

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

 

EESignature

0 Likes
Message 5 of 6

Anonymous
Not applicable

EXCELLENT!!! Worked perfectly!!

 

Thanks so much for your help

 

Steve

0 Likes
Message 6 of 6

Anonymous
Not applicable

EXCELLENT!!!

 

Worked perfectly!!

 

Thanks so much for your help

 

Steve

0 Likes