Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
719 Views, 5 Replies

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

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

Tags (1)
5 REPLIES 5
Message 2 of 6
Curtis_Waguespack
in reply to: Anonymous

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

 

Message 3 of 6
Anonymous
in reply to: Curtis_Waguespack

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
Message 4 of 6
Curtis_Waguespack
in reply to: Anonymous

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

 

Message 5 of 6
Anonymous
in reply to: Anonymous

EXCELLENT!!! Worked perfectly!!

 

Thanks so much for your help

 

Steve

Message 6 of 6
Anonymous
in reply to: Curtis_Waguespack

EXCELLENT!!!

 

Worked perfectly!!

 

Thanks so much for your help

 

Steve

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report