12-06-2016 09:49 AM
Hello,
I am trying to select the 'FileImportFilter' to be used at the moment of loading certain data using a script. For that, in the UserCommand defined to the event 'OnFileLoading' (triggered before the data is loaded) I am saying:
Sub MyOnFileLoading (NaviLoadControl, DataFileName, ImportAction, FileImportFilter, ImportSelection)
Select Case LCase(NameSplit(DataFileName,"E"))
Case "mfx"
FileImportFilter="MDF4"
Case Else
End Select
However, the data is not loaded and the message box for selecting one of the data plugins availables is shown.
Can anyone help me with this? There is other way to select the data plugin to used before the loading of a data starts?
Thank you,
Andres Uribe 🙂
Solved! Go to Solution.
12-07-2016 04:56 PM
Hi Andres,
Do you have the DataPlugin installed for the MDF4 file? This is not one of the native values of the variables. Additionally, if you are using the Recording mode, you can open the file with the appropriate filename extension in the Open dialog box to specifiy the value of the FileImportFilter.
http://zone.ni.com/reference/en-XX/help/370858M-01/varoff/fileimportfilter/
12-08-2016 01:04 AM
The given parameters are only input parameters.
The idea is that you can prepare something inside DIAdem before loading.
There is the capability to avoid the loading by setting
NaviLoadControl = "SkipLoadCmd"
It is important to be careful with this option because afterwards DIAdem might behave currious in some scenarios.
So if you intend using it your code has to look like
Option Explicit Call AddUserCommandToEvent("Navigator.Events.OnFileLoading","MyOnFileLoading") Sub MyOnFileLoading (NaviLoadControl, DataFileName, ImportAction, FileImportFilter, ImportSelection) Select Case LCase(NameSplit(DataFileName,"E")) Case "mfx" if "" = ImportSelection then call DataFileLoad(DataFileName, "MDF4", ImportAction) else call DataFileLoadSel(DataFileName, "MDF4", ImportSelection, ImportAction) end if NaviLoadControl = "SkipLoadCmd" Case Else End Select End Sub