- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am having a problem with Inventor DWG files. After moving to Vault they seem to have a reference to a bitmap. I found an older posting in the Vault forums which highlights the issue.
How can I remove this reference with the Inventor API? Using the AutoCAD API is not an option. Or is there any other fix possible?
Regards,
Pim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
for this problem I use my inventor macro (seven years old). I tryed it only for idw. You can try it for dwg.
Sub Vymaz_ExtRef()
Dim oDoc As Inventor.Document
Dim ref As Inventor.ReferencedOLEFileDescriptor
Dim i As Integer
Dim names As String
'get external references:
Set oDoc = ThisApplication.ActiveDocument
names = ""
i = 1
For Each ref In oDoc.ReferencedOLEFileDescriptors
names = names & Chr(10) & Chr(13) & ref.DisplayName & " = " & ref.FullFileName
ref.Delete
i = i + 1
Next
MsgBox ("References:" & names)
End Sub
Dell Precision T3620
Inventor 2019, Autocad Mechanical 2019, Vaul Basic 2019
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Thanks for your reply. I looked at the ReferencedOLEFileDesscriptors, but the collection is empty. Still the reference is shown when I try to check in the file in to Vault. Because the file doesn't really exist it blocks me from checking in the file.
The weird thing is that the XRef Manager in AutoCAD is showing the bitmap as unreferenced and I can remove the reference there. Therefore I added a reference to the AutoCAD Type Library in Inventor VBA allowing me to set a reference to the ContainingDWGDocument property of the DrawingDocument. In the AcadDatabase however, I am unable to find the XRef.
Hope there it's possible to programmatically remove the reference, because I have a lot of drawing documents which needs to be checked in to Vault.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi psaarloos,
I'm not sure about using the API, but aan you use this break link tool as shown in this image?
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Thank you very much for your suggestion. Unfortunately the 'Links' command is disabled (probably because it can't find link). Another weird thing though; Design Assistent is complaining about the missing reference as well. As far as I know Design Assistent is using Inventor Apprentice, but can't find the reference to the bitmap in the ApprenticeServerDocument either...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've found a solution by adding a reference to the AutoCAD Type Library from within Inventor VBA and accessing the ContainingDWGDocument object. Hoipefully it help somebody else with the same issue.
Regards,
Pim
Dim odoc As DrawingDocument
Set odoc = ThisApplication.ActiveDocument
Dim acad As AcadDatabase
Set acad = odoc.ContainingDWGDocument
Dim removed As Boolean
On Error Resume Next
Dim acadObj As Object
For Each acadObj In acad.Dictionaries
If TypeOf acadObj Is AcadDictionary Then
If acadObj.Name = "ACAD_IMAGE_DICT" Then
Dim acadImageDict As AcadDictionary
Set acadImageDict = acadObj
acadImageDict.Remove "<imagename>"
removed = True
Exit For
End If
End If
Next
On Error GoTo 0
If removed Then
odoc.Update2
odoc.Save
ThisApplication.CommandManager.ControlDefinitions("VaultRefresh").Execute
End If
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report

