Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic rule all of a sudden not working

Anonymous

iLogic rule all of a sudden not working

Anonymous
Not applicable

Greetings all

 

I have been using an ilogic rule for some time without any issues. The code (see below) I got from Curtis Waguespacks's site from memory. A really good resource for productivity in my case; it writes data from a spreadsheet to the title block, labels etc.

 

All of a sudden it will no longer work! Any ideas on how to get this thing working again?

 

I have not changed a thing - before you ask...

 

'Browse for the Excel file
Dim oFileDlg As inventor.FileDialog = Nothing
InventorVb.Application.CreateFileDialog(oFileDlg)
oFileDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
oFileDlg.DialogTitle = "Select a Project Information Excel File"
oFileDlg.InitialDirectory = ThisDoc.Path
oFileDlg.CancelError = True
On Error Resume Next
oFileDlg.ShowOpen()
If Err.Number <> 0 Then
'exit if file not selected
Return
ElseIf oFileDlg.FileName <> "" Then
myXLS  = oFileDlg.FileName
End If

'look at sheet1 of the spreadsheet
GoExcel.Open(myXLS, "Sheet1")


Dim oName As String = GoExcel.CellValue("A1")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B1")
oName = GoExcel.CellValue("A2")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B2")
oName = GoExcel.CellValue("A3")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B3")
oName = GoExcel.CellValue("A4")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B4")
oName = GoExcel.CellValue("A5")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B5")
oName = GoExcel.CellValue("A6")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B6")
oName = GoExcel.CellValue("A7")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B7")
oName = GoExcel.CellValue("A8")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B8")
oName = GoExcel.CellValue("A9")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B9")
oName = GoExcel.CellValue("A10")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B10")
oName = GoExcel.CellValue("A11")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B11")
oName = GoExcel.CellValue("A12")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B12")
oName = GoExcel.CellValue("A13")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B13")
oName = GoExcel.CellValue("A14")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B14")
oName = GoExcel.CellValue("A15")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B15")
oName = GoExcel.CellValue("A16")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B16")
oName = GoExcel.CellValue("A17")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B17")
oName = GoExcel.CellValue("A18")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B18")
oName = GoExcel.CellValue("A19")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B19")
oName = GoExcel.CellValue("A20")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B20")
oName = GoExcel.CellValue("A21")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B21")
oName = GoExcel.CellValue("A22")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B22")
oName = GoExcel.CellValue("A23")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B23")
oName = GoExcel.CellValue("A24")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B24")
oName = GoExcel.CellValue("A25")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B25")
oName = GoExcel.CellValue("A26")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B26")
oName = GoExcel.CellValue("A27")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B27")
oName = GoExcel.CellValue("A28")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B28")
oName = GoExcel.CellValue("A29")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B29")
oName = GoExcel.CellValue("A30")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B30")
oName = GoExcel.CellValue("A31")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B31")
oName = GoExcel.CellValue("A32")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B32")
GoExcel.Close

Reply
1,184 Views
10 Replies
Replies (10)

Xun.Zhang
Alumni
Alumni

Hello @Anonymous,

Is there any automatically updates for the windows system or office 365 in your side?

It appears that my office 365 automatically upgrade to 1809 version. Smiley Mad

Untitled.png

Thanks!


Xun
0 Likes

rhasell
Advisor
Advisor

Hi

Not to state the obvious, but have you done a restart?

I am not saying that this is the issue in your case, but I speak from past experience, that when the rules suddenly stop working, a restart always fixes it.

 

Also something I discovered, clearing the temp folder solves quite a few issues.

Your code works on my system, but I am still running office 2010.

 

Reg
2025.2
0 Likes

Anonymous
Not applicable

I also am running office 2010. I have tried restarting a number of times; to no avail.

 

I have Windows 10 updates turned off as last time it updated Inventor would not work!

 

I will try clearing the temp folder when I get back to my laptop.

 

FYI; I'm using Inventor 2016 Pro.

0 Likes

johnsonshiue
Community Manager
Community Manager

Hi! This could be Windows related. Somehow Inventor 2016 no longer can start an Excel process. Try this and see if the theory is true. Open any existing part and go to Manage -> Create iPart. Does it work? If yes, it could be iLogic specific. If it does not work, it means Inventor cannot kick off an Excel process. You might need to re-register Inventor. Try the two followings.

1) Go to Control Panel -> Programs and Features -> find Inventor Pro 2016 -> right-click on it -> Uninstall/Change -> Repair Install.

Does the iLogic rule run now?

2) Go to command prompt -> cmd -> type "C:\Program Files\Autodesk\Inventor 2016\bin\Inventor.exe /install" and hit <Enter>. This will re-register Inventor 2016.

Does it run now?

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

rhasell
Advisor
Advisor

That's odd.

 

Are you able to shed some more light on the problem?

Are there any error messages?

Does some of the code run? (eg, start browsing for an excel file)

 

Try and add some message boxes in the code to debug it.

 

Reg
2025.2
0 Likes

rhasell
Advisor
Advisor

@johnsonshiue

 

LOL

Your post came in while I was typing a response.

 

Reg
2025.2
0 Likes

Anonymous
Not applicable

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

 

The control panel method did not work either.

0 Likes

Anonymous
Not applicable

Cleared out temp folders. No luck.

 

The code runs as in it looks for a spreadsheet. No error messages whatsoever.

0 Likes

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous,

 

I tested this with Inventor 2017 and Windows 10, Office 365 Excel version 1809, build 10827.20138, and it works as expected.

 

Try this example version of the code, it should give you a couple of messages that might help confirm that the rule is working, one showing the selected excel file, and one showing the resulting iProperty info. If those don't show the results expected then you might post back, and that might give a hint as to what the problem is. 

 

Note too that this example has an Update line at the end, this is needed when working with a title block to "refresh" the sheet and show that the custom iprops have changed, otherwise the drawing doesn't update when the rule has finished, but will on save, etc.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

'Browse for the Excel file
Dim oFileDlg As inventor.FileDialog = Nothing
InventorVb.Application.CreateFileDialog(oFileDlg)
oFileDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
oFileDlg.DialogTitle = "Select a Project Information Excel File"
oFileDlg.InitialDirectory = ThisDoc.Path
oFileDlg.CancelError = True
On Error Resume Next
oFileDlg.ShowOpen()
If Err.Number <> 0 Then
'exit if file not selected
MessageBox.Show("Some Error Happened", "iLogic")
Return
ElseIf oFileDlg.FileName <> "" Then
myXLS  = oFileDlg.FileName
MessageBox.Show("Excel File = " & myXLS, "iLogic")
End If

'look at sheet1 of the spreadsheet
GoExcel.Open(myXLS, "Sheet1")


Dim oName As String = GoExcel.CellValue("A1")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B1")
oString = iProperties.Value("Custom", oName)

oName = GoExcel.CellValue("A2")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B2")
oString = oString & " | " & iProperties.Value("Custom", oName)

oName = GoExcel.CellValue("A3")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B3")
oString = oString & " | " & iProperties.Value("Custom", oName)

GoExcel.Close

MessageBox.Show(oString, "iLogic")

InventorVb.DocumentUpdate()

 

Anonymous
Not applicable

Curtis

 

Appreciate the code you supplied, and apologies; I’ve had a bit on.

 

Your code works as in I get an iLogic dialog confirming the excel file: ‘Excel File =’ but unfortunately it still does not populate the title block after saving.

 

I remembered this week that I had office 365 on this laptop, which was giving me grief, so uninstalled it. Not sure if that would have effected anything, so I’ve since uninstalled and reinstalled Office 2010, but still the error exists.

0 Likes