DIAdem Help

Method: LoadData for Navigator

  • Updated2024-09-12
  • 4 minute(s) read

Method: LoadData for Navigator

Loads one or more elements from the search results, the file browser, or the data browser into the Data Portal, or registers these elements in the Data Portal.

Set oElementList = Object.LoadData(ImportObject, [ImportAction], [ImportSettings])
ObjectNavigator
Object with this method
ImportObjectVariant
Specifies which elements to load.
[ImportAction]Variant
Specifies how DIAdem imports data into the Data Portal. Use the ImportParameter object for the ImportAction parameter. You can also use the following script terms as an alternative. The value range is identical to the value range in the ImportAction variable.
Script Term Interface Term, Explanation
"Load"
Load
"Append"
Append

[ImportSettings]Variant
Specifies the Loading configuration as object. You can only use a loading configuration if you load data from data stores. NI recommends you use the loading configuration of the ImportParameter object instead of the ImportSettings parameter.
Value Meaning
ImportParameter object DIAdem uses the loading configuration you assigned to the ImportParameter object.
Nothing
If you assign the value Nothing to the ImportSettings parameter, DIAdem creates the standard browse setting for the open data store (Test/SubTest - Measurement - MeasurementQuantity), generates a minimum loading configuration, and then only transfers the name, the unit, and the description of each element into the Data Portal.
No value If you do not assign a value to the ImportSettings parameter, DIAdem uses the loading configuration of the data store currently open in DIAdem NAVIGATOR.
oElementListElementList <Data>
Returned object
Element list with the elements. Use the LoadReturnMode property to specify which elements the element list contains.

Always specify the ImportSettings parameter when you use the LoadData method if the import objects are not from the opened DataFinder or data store. If you use the parameter ImportSettings and assign the ImportParameter object to the parameter ImportAction, the ImportSettings settings overwrite the loading configuration of the ImportParameter object.

If you use the ImportParameter object for the ImportAction parameter, the LoadData method supports the following properties: ImportMode, LoadReturnMode, AppendCheckGroupName, PropertyHandling.AutoUpdateChnCharacteristics (only for files), PropertyHandling.InheritanceSeparator, PropertyHandling.InheritanceMode, PropertyHandling.NamingSchema, PropertyHandling.NameMapping (only for files), PropertyHandling.ValueMappingFile (only for files), and PropertyHandling.ImportSet.

The following example loads the elements selected in the browser of a data store with the loading configuration MyPropertyImportSet into the Data Portal:

VBScriptPython

 

Dim oMyDataProvider, oMyElements, oMyPropertyImportSet
Call Navigator.Display.OpenDataStore("ASAM Browse Settings Example")
Set oMyDataProvider = Navigator.Display.CurrDataStore.GetDataStore
Set oMyElements = Navigator.Display.CurrDataStore.Browser.SelectedElements

Set oMyPropertyImportSet = Navigator.Settings.LoadPropertyImportSet("D:\MyPropertyImportSet.tdl", oMyDataProvider)
Call Navigator.LoadData(oMyElements,"Load", oMyPropertyImportSet)

The following example loads the elements of a data store without an interface, which was selected with a script, with the standard loading configuration:

VBScriptPython

 

Dim oMyDataProvider, oMyElements, oMyPropertyImportSet, oMyLoadedElements
Set oMyDataProvider = Navigator.ConnectDataStore("ASAM Browse Settings Example")
Set oMyElements = oMyDataProvider.RootElements(1).Children(1).Children
Set oMyPropertyImportSet = Navigator.Settings.CreatePropertyImportSet(oMyDataProvider)
Set oMyLoadedElements = Navigator.LoadData(oMyElements, "Load", oMyPropertyImportSet)

The following example uses the loading configuration specified in the oMyImportParameter object to load the element selected in the browser of the data store into the Data Portal:

VBScriptPython

 

Dim oMyDataProvider, oMyElements, oMyImportParameter
Call Navigator.Display.OpenDataStore("ASAM Browse Settings Example")
Set oMyDataProvider = Navigator.Display.CurrDataStore.GetDataStore
Set oMyElements = Navigator.Display.CurrDataStore.Browser.SelectedElements

Set oMyImportParameter = Navigator.Settings.CreateImportParameter()
oMyImportParameter.AppendCheckGroupName = eAppendCheckGroupNameAutomatic 
oMyImportParameter.BulkDataLoadingMode = eBulkDataLoadingOnFirstAccess
oMyImportParameter.ImportMode = eLoad
oMyImportParameter.PropertyHandling.AutoUpdateChnCharacteristics = True
oMyImportParameter.PropertyHandling.InheritanceMode = ePropInheritanceCopyToChannelLevel

Call Navigator.LoadData(oMyElements, oMyImportParameter)