iLogic Link 3rd party Excel

iLogic Link 3rd party Excel

Anonymous
Not applicable
1,478 Views
4 Replies
Message 1 of 5

iLogic Link 3rd party Excel

Anonymous
Not applicable

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?

0 Likes
Accepted solutions (1)
1,479 Views
4 Replies
Replies (4)
Message 2 of 5

adam.nagy
Autodesk Support
Autodesk Support

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,

 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks., but I don't know how to use the API.

How do I "call"  it?

 

doc1 = ThisDoc.ReferencedOLEFileDescriptors.item(1)
0 Likes
Message 4 of 5

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

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:

http://modthemachine.typepad.com/my_weblog/2008/09/inventor-api-fundamentals-003---the-object-model....

 

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:

http://adndevblog.typepad.com/manufacturing/2014/04/remove-missing-ole-links-using-referencedolefile...

 

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,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 5 of 5

Anonymous
Not applicable
Wow, thanks.
0 Likes