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: 

delete links to external files

8 REPLIES 8
Reply
Message 1 of 9
GeorgK
751 Views, 8 Replies

delete links to external files

Hi,

 

Is it possible through VB or VBA to delete links to external files?

 

Thank you very much

 

Georg

8 REPLIES 8
Message 2 of 9
xiaodong_liang
in reply to: GeorgK

Hi,

 

What kind of external file you are referring to? If derived part, you could use 

   DerivedPartComponent.BreakLinkToFile 

 

As to 3rd files (OLE), you could choose type when adding

   ReferencedOLEFileDescriptors.Add (FullFileName As String, [Type] As OLEDocumentTypeEnum)

 where

  OLEDocumentTypeEnum: kOLEDocumentEmbeddingObject means it is Embedding Document, not link document.

  

 

 

Message 3 of 9
GeorgK
in reply to: xiaodong_liang

Hi,

 

I mean jpg or bmp files. Thank you.

 

Georg

Message 4 of 9
xiaodong_liang
in reply to: GeorgK

Hi,

 

so, the relevant API object is  ReferencedOLEFileDescriptor. But no method to change its type from OLE link to embed, either does UI. If you want to delete the OLE, the method is ReferencedOLEFileDescriptor.Delete.

Message 5 of 9
miechh
in reply to: xiaodong_liang

When opening the dialog "Links" I can see which items are unresolved; these have the text "No" in the column "Resolved". How can I determine through VBA which items are unresolved? I can't seem to find a property in ReferencedOLEFileDescriptors which indicate this.


Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)
Message 6 of 9
rjay75
in reply to: miechh
Message 7 of 9
miechh
in reply to: GeorgK

Well, the strange thing is:

I have an assembly which has multiple referenced files, most of them are parts of course which are resolved. Two of them are texture bitmaps which are unresolved according to the "Links" dialog (Tools ribbon --> Options --> Links). But when analyzing the ThisAssy.Document.Files.ReferencedFileDescriptors these two bitmaps have the ReferenceMissing property set to False like all the other referenced (and resolved) files..... Smiley Surprised. I expected these two unresolved files to have the ReferenceMissing property set to "True". So it seems I can't rely on that property.


Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)
Message 8 of 9
GeorgK
in reply to: miechh

Do you have a sample code for the check?

Message 9 of 9
miechh
in reply to: GeorgK

Not yet. At this moment I'm using just the Watch-pane to analyze the different properties of the .Document.Files.ReferencedFileDescriptors. It's no use programming code when knowing that the desired properties don't have the values as expected.

Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)

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

Post to forums  

Autodesk Design & Make Report