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: 

iLogic Link 3rd party Excel

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
KaufmanHome
1252 Views, 4 Replies

iLogic Link 3rd party Excel

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?

4 REPLIES 4
Message 2 of 5
adam.nagy
in reply to: KaufmanHome

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
Message 3 of 5
KaufmanHome
in reply to: adam.nagy

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

How do I "call"  it?

 

doc1 = ThisDoc.ReferencedOLEFileDescriptors.item(1)
Message 4 of 5
adam.nagy
in reply to: KaufmanHome

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
Message 5 of 5
KaufmanHome
in reply to: adam.nagy

Wow, thanks.

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

Post to forums  

Autodesk Design & Make Report