OnFileResolution with Content Center parts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I have an issue with the OnFileResolution event in my AddIn. I'm hoping you can help me. I already have "embedded interop types" set to false, so unfortunately this is not my issue.
In most case, I can use my custom file resolution logic to give inventor a file path. However, when trying to resolve a content center part, Inventor seems to simply ignore the file path I'm providing.
Stepping through the code, I can see I'm providing the correct path on disk. However, the file is still unresolved when the assembly finishes opening. However, If I "right click -> Resolve file" in the model browser, Inventor finds the files without issues (at the path I'm providing in the code).
We are using Inventor 2019. We are planning to upgrade to 2022 soon, so I tested 2022 and the issue also happen.
In 2022, each unresolved file asks for manual input and providing the file does nothing (popup comes back, only skip works). And then "right click -> Resolve file" works as expected (same as 2019).
I also noticed that the event does not fire "after" for content center parts, even if the part is not resolved. So it may be a bug in Inventor?
Below is my code:
Private Sub FileAccessEvents_OnFileResolution(RelativeFileName As String, LibraryName As String, ByRef CustomLogicalName() As Byte, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef FullFileName As String, ByRef HandlingCode As HandlingCodeEnum) Handles FileAccessEvents.OnFileResolution
HandlingCode = HandlingCodeEnum.kEventNotHandled
Dim tentativePath As String = CustomFileResolution(RelativeFileName, LibraryName, Context)
If IO.File.Exists(tentativePath) Then
HandlingCode = HandlingCodeEnum.kEventHandled
FullFileName = tentativePath
End If
End Sub