OnFileInsertDialog

OnFileInsertDialog

alder_moriggi
Enthusiast Enthusiast
512 Views
2 Replies
Message 1 of 3

OnFileInsertDialog

alder_moriggi
Enthusiast
Enthusiast

Hi all, in .net I would like to intercept the component replace event (single and multiple).
As a guide inventor, I've tried to use the "FileUIEvents.OnFileInsertDialog" event but it doesn't work ...
I set "FileName" and "HandlingCode" the parameters but always appears the standard dialog without path and filename.
Anything else to set? What's wrong?

 

TIA

Alder

 

Private Sub m_fileEvents_OnFileInsertDialog(ByRef FileTypes() As String, DocumentObject As _Document, ParentHWND As Integer, ByRef FileName As String, ByRef RelativeFileName As String, ByRef LibraryName As String, ByRef CustomLogicalName() As Byte, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_fileEvents.OnFileInsertDialog
   FileName = "C:\DIERRE\Designs\DIERRE\aa\AAAGU0000150.ipt"
   HandlingCode = HandlingCodeEnum.kEventHandled
End Sub

0 Likes
513 Views
2 Replies
Replies (2)
Message 2 of 3

YuhanZhang
Autodesk
Autodesk

If the dialog still pops up that seems your code does not catch the event, can you add a breakpoint in the event code and debug it to see if it will run into the code? If it does not hit the code, then you can check if you defined the m_fileEvents as a member of the Class but not a function, and if the m_fileEvents  is set properly, and if you added proper event handler for the event etc.. And you can also refer to the sample code in the SDK (C:\Users\Public\Documents\Autodesk\Inventor 2018\SDK\DeveloperTools\Samples\VB.NET\AddIns\SimpleAddIn) to see how to change your code. If you still have problem you can attach your project here and we can have a look into it.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 3

marcin_otręba
Advisor
Advisor

it work fine..

 

 Private WithEvents f_uievents As FileUIEvents

 

 

out it in addin activation sub:

g_inventorApplication = addInSiteObject.Application
f_uievents = g_inventorApplication.FileUIEvents

 

 Private Sub m_fileEvents_OnFileInsertDialog(ByRef FileTypes() As String, DocumentObject As _Document, ParentHWND As Integer, ByRef FileName As String, ByRef RelativeFileName As String, ByRef LibraryName As String, ByRef CustomLogicalName() As Byte, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles f_uievents.OnFileInsertDialog
            FileName = "C:\Vault\Projekty\36000\Typowe\36001\32-9-900851.ipt"
            MsgBox(FileName)
            HandlingCode = HandlingCodeEnum.kEventHandled
        End Sub

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes