Is there any way we can notify Inventor that excel sheet is updated?

Is there any way we can notify Inventor that excel sheet is updated?

dutt.thakar
Collaborator Collaborator
1,019 Views
7 Replies
Message 1 of 8

Is there any way we can notify Inventor that excel sheet is updated?

dutt.thakar
Collaborator
Collaborator

I have created an iLogic rule that takes some values from excel and add to components properties located in an assembly. My objective is, I don't want to link or embed the excel, but still some how I want to achieve that, if something new to excel sheet is added or updated and whenever someone opens the assembly that has this rule I created to update the properties, they get notified (probably with a message box or by any other means) that excel has got new updates. Make sure you run your code and make some changes in assembly.

 

Is it possible with iLogic code or by any other means? Again, I don't want to link or embed my excel sheet with Assembly file.

 

Looking forward for some great ideas.

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Accepted solutions (1)
1,020 Views
7 Replies
Replies (7)
Message 2 of 8

JhoelForshav
Mentor
Mentor
Accepted solution

My suggestion is this:

You create a text parameter in the inventor document named ExcelUpdate (in my example)

 

Create a rule that looks something like this:

 

Dim oLastChanged As String = IO.File.GetLastWriteTime("Path to excel file")

If ExcelUpdate <> oLastChanged
	iLogicVb.RunRule("UpdateRule")
End If

ExcelUpdate = oLastChanged

Set an event trigger "After open document" to run this rule.

If the Excelfile has been saved since last time you opened the inventor document it will run the rule to update according to the excel file. (In my example it's called UpdateRule)

Finally the rule updates the ExcelUpdate parameter to the last version of the excel-file it updated from 🙂

Message 3 of 8

bradeneuropeArthur
Mentor
Mentor

Are you using Vault?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 8

fullevent
Advisor
Advisor

Hello @dutt.thakar,

 

My first approach would be this:
Excel has a defined cell in which a timestamp is always written before the file is saved. (automatically by event)

 

The assembly has a new iProperty which also contains a timestamp.

 

In addition the assembly gets a new rule which compares these two timestamps. If the time stamp in Excel is newer than in the assembly, then the desired message box should appear. This verification can, for example, always take place when the assembly is opened. (automatically by event)

 

Your already existing rule gets the addition that at the end the time stamp of Excel is copied into the new iProperty.

 

Does this help you?

 

Greetings,
Aleks


Aleksandar Krstic
Produkt- und Projektmanager

0 Likes
Message 5 of 8

dutt.thakar
Collaborator
Collaborator

Yes I do use Vault

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 6 of 8

dutt.thakar
Collaborator
Collaborator

Thanks for the great tip. I tried it is working as per the description I mentioned. A small thing if there is a difference of 1 second in save time of excel and Inventor assembly, it will always run the rule. Below is the rule you mentioned and I added message box to get the info if rule triggering is required or not and I am adding Hour so that It checks the same hour if assembly and excel are updated and then give appropriate messagebox.

Dim oLastChanged As String = IO.File.GetLastWriteTime(ThisDoc.Path & "\Property Exchange.xlsx").Hour

If ExcelUpdate <> oLastChanged
	MessageBox.Show("Excel is Updated, Run the rule")
Else If ExcelUpdate = oLastChanged
	MessageBox.Show("Everything is upto date")
End If

ExcelUpdate = oLastChanged

 

Is there any way that if excel is saved prior but still if there is no change in it, It does not ask for update?

Or any other solution?

 

Regards,

 

Dutt.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 7 of 8

dutt.thakar
Collaborator
Collaborator

I think it's similar what @JhoelForshav  has mentioned.

 

Correct?

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 8 of 8

fullevent
Advisor
Advisor

Yes i think so. He was a little faster. I had to translate first 🙂

 

Personally, I might round to one minute. Even within a minute, a change can occur in the Excel and be saved.

 

The problem is when something is written and deleted in an empty cell in Excel, nothing has changed, but for Excel something has changed and the user is asked to save it.
So it is saved without any noticeable change.

 

What you probably mean would be very time intensive... to scan the file for changes. I don't think such a function already exists.

 

Anyway, the "worst case" would be that your rule is executed without it being necessary. But how often is an Excel saved again without any noteworthy changes to the data?

 

Greeting

 

 


Aleksandar Krstic
Produkt- und Projektmanager

0 Likes