I'm looking to use iLogic to change the Excel links in an assembly's sub-assemblies.
I can change the link, but I can't seem to identify the current link within ilogic.
changeOK = GoExcel.ChangeSourceOfLinked(partialOldName, newName)
I'd like to identify a link, check if it is the required link and if no, change it to the new link.
Could anyone direct me to an iLogic comand to identify the current linked Excel file name?
Solved! Go to Solution.
Solved by adam.nagy. Go to Solution.
Hi,
You can use the Inventor API from iLogic (which iLogic itself is built on). Have a look at Document.ReferencedOLEFileDescriptors
That should tell you the full file name of referenced Excel files.
Cheers,
Thanks., but I don't know how to use the API.
How do I "call" it?
doc1 = ThisDoc.ReferencedOLEFileDescriptors.item(1)
VBA is the easiest way to get familiar with the API: it has intellisense and object browser, and you can also debug into the code:
Once you have a working code you can easily convert it to VB.NET that iLogic is using too: quite often you'll just have to remove the "Set" keywords from your code.
Here is a VBA code dealing with OLE objects:
And here is an iLogic Rule code I wrote that pops up a dialog with the full path of each OLE object:
Dim doc As Document doc = ThisApplication.ActiveDocument Dim d As ReferencedOLEFileDescriptor For Each d In doc.ReferencedOLEFileDescriptors Call MsgBox(d.FullFileName) Next
Cheers,