Input multi documents for onFileInsertDialog

By Xiaodong Liang

In UI, [Place Component] can select multi documents. You can do so by the API OnFileInsertDialog.  The documents name should be separated by ‘|’.

' delegation function
Private Sub oFileUIEvents_OnFileInsertDialog( _                ByRef FileTypes() As String, _                ByVal DocumentObject As Inventor._Document, _                ByVal ParentHWND As Integer, _                ByRef FileName As String,  _                ByRef RelativeFileName As String, _                ByRef LibraryName As String, _                ByRef CustomLogicalName() As Byte, _                ByVal Context As Inventor.NameValueMap, _                ByRef HandlingCode As Inventor.HandlingCodeEnum)              FileName = "c:temppart2.ipt|c:temppart3.ipt"         HandlingCode = HandlingCodeEnum.kEventHandled          End Sub             ' start FileUIEvents
Private Sub startEvent()                ' assume we have got Inventor application       Dim oFileUIEvent As FileUIEvents =  _                   _InvApplication.FileUIEvents       AddHandler oFileUIEvent.OnFileInsertDialog,  _        AddressOf oFileUIEvents_OnFileInsertDialog           End Sub             ' stop FileUIEvents
<p style="margin: 0px"><span style="line-height: 140%;color: blue">Private</span><span style="line-height: 140%"> </span><span style="line-height: 140%;color: blue">Sub</span><span style="line-height: 140%"> stopEvent(</span><span style="line-height: 140%">)</span>&#160;</p>    <p style="margin: 0px"><span style="line-height: 140%;color: green">&#160; ' assume we have got Inventor application</span></p>    <p style="margin: 0px"><span style="line-height: 140%;color: blue">&#160;&#160; Dim</span><span style="line-height: 140%"> oFileUIEvent </span><span style="line-height: 140%;color: blue">As</span><span style="line-height: 140%"> File

UIEvents =  _

              _InvApplication.FileUIEvents

RemoveHandler oFileUIEvent.OnFileInsertDialog,AddressOf _                oFileUIEvents_OnFileInsertDialog

      

End Sub

 

Share this:

Like this:

Like Loading…

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading