.. highlight:: us .. index:: DocAddDatafiles .. _DocAddDatafiles: DocAddDatafiles =============== .. us.tag DocAddDatafiles DocSet New6701 :ref:`DocAddDatafiles` adds a file to a set of pages or a complete document. .. function:: hDoc = DocAddDatafiles(hDoc, rsMainFileID, svFiles) hDoc = DocAddDatafiles(hvPages, rsMainFileID, svFiles) hDoc = DocAddDatafiles(hDoc, rsMainFileID, svFiles, oPara) hDoc = DocAddDatafiles(hvPages, rsMainFileID, svFiles, oPara) .. us.return **Return Value** Document handle hDoc is returned. Returns 0 in case of error. .. us.params **Parameters** .. uparam:: hDoc *hDoc* is a handle of an UniPlot document. .. uparam:: hvPages *hvPages* is a vector with page handles. .. uparam:: rsMainFileID *rsMainFileID* is the file that will be taken as a reference for new files addition. .. uparam:: svFiles *svFiles* is a vector with the path of the data files that will be imported and added to the document on the base of the *rsMainFileID*. .. uparam:: oPara *oPara* is an object created with :ref:`obj_create`. The object can be used to pass parameters. The default values are the last interactive specified values. .. list-table:: :header-rows: 1 * - 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. .. us.example **Example** :: hDoc = AppGetActiveDocument() svFiles = GetOpenFileName("","",1,1) rsMainFileID = 1 //Select the file to copy if (hDoc == 0){ MessageBoxError("No open template") return; } else { hDoc = DocAddDatafiles(hDoc,rsMainFileID,svFiles) } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2025.1 - New. .. seealso:: :ref:`overview-documents`, :ref:`DocCreate`, :ref:`DocExchangeDataFiles`, :ref:`datadata-exchange-(page)`, :ref:`DocGetDataFileList`, :ref:`DocSetDataFileList` :sub:`id-1653200`