DocExchangeDataFilesΒΆ
DocExchangeDataFiles executes a data exchange for a complete document.
-
bool = DocExchangeDataFiles(hDoc, smMatrix)
-
bool = DocExchangeDataFiles(hvPage, smMatrix)
-
bool = DocExchangeDataFiles(hvPage, smMatrix, oPara)
Return Value
Parameters
-
hDoc
hDoc is a handle of an UniPlot document. hvPage is a vector with page handles.
-
smMatrix
smMatrix is a matrix with 7 columns:
Column Alias Description 1 DS_FILE_ORIGIN Original data file name. For Excel files the sheet name can be added to the file name in square brackets. 2 DS_FILE_NCNAME Name of the NC file. 3 DS_FILE_ACTION Action string. 4 DS_FILE_STYLEPROPS 2D style attributes. 5 DS_FILE_STYLEPROPS3D 3D style attributes. 6 DS_FILE_COMMENT Comment string. 7 DS_FILE_RECORDFILTER Record filter: See auto_SetFilter Valid values for the action string (see example and Data=>Data Exchange (Page)):
Value (String) Description ""
(empty string), Exchange data. "UNCHANGED"
ignore datasets. "SETTOZERO"
set to 0. "SETSTYLEONLY"
Only style properties will be set. The data points will not be modified.
-
oPara
oPara is an object created with obj_create. The object can be used to pass parameters. The default values are the last interactive specified values.
Element Description bUpdatePlaceholder If TRUE (1): Dollar placeholders will be updated.. nRecordFilter Value = 1: Use Record Filter specified in Data files, Value = 2:Use Record Filter specified in Datasets (Curve), Value = 3: Do not use Record Filter. bAutoscale If TRUE (1): All axes will be auto scaled. bResetDatasetScaling If TRUE (1): Scale factor and offset will be set to default values (1, 0). bDisplayChannelReplaceDialog If set to TRUE (1), a dialog box is displayed to replace missing channels by valid channels.
Example
RegisterCommand("Data", "MyDataExchange", "My Data Exchange");
UserBar_Add("MyDataExchange");
def MyDataExchange()
{
hDoc = AppGetActiveDocument();
if (hDoc == 0) {
MessageBoxError("No active Document");
return FALSE;
}
smF = DocGetDataFileList(hDoc);
smF[1;DS_FILE_ORIGIN] = "c:/programme/uniplot/samples/TEST4.xls [data]";
smF[1;DS_FILE_COMMENT] = "This is a comment";
smF[1;DS_FILE_ACTION] = ""; // Exchange data
obj = [.];
obj.nRecordFilter = 1;
obj.bAutoscale = TRUE;
DocExchangeDataFiles(hDoc, smF, obj);
PageReplot(DocGetActivePage(hDoc));
return TRUE;
}
History
Version | Description |
---|---|
R2015.5 | New column added: DS_FILE_RECORDFILTER |
R2012.3 | New parameter oPara |
5.15.6 | Can be invoked with a page handle to exchange the data for one or more pages. |
5.11.0 | New. |
See also
Overview Documents, DocCreate, Data=>Data Exchange (Page), DocGetDataFileList, DocSetDataFileList
id-608347