02-04-2016
01:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-04-2016
01:38 AM
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

