PageGetAllDatasets¶
PageGetAllDatasets returns a vector with the handles of all datasets of the given page.
-
hvData = PageGetAllDatasets(hPage)
-
hvData = PageGetAllDatasets(hPage, bOnlyVisible)
-
hvData = PageGetAllDatasets(hPage, bOnlyVisible, ssType)
Return Value
hvData is a vector with dataset handles. If a page does not contain any datasets the function returns the value 0.
Parameters
-
hPage
Identifies the page.
-
bOnlyVisible
If bOnlyVisible is TRUE (1) only the visible datasets are returned. See also XYIsVisible or XYZIsVisible. Default value is FALSE (0).
-
ssType
If ssType is “OBJ_XYZDATASET” the function returns only 3D datasets. If ssType is “OBJ_XYDATASET” the function returns only 1D and 2D datasets. If ssType is an empty string the function returns all datasets. Default value is “”.
Example
Create a list of all used channels in the active document.
RegisterCommand("2D-Dataset", "_list_used_channel_names", "Create Used Channel Name List");
UserBar_Add("_list_used_channel_names");
def _list_used_channel_names()
{
hDoc = AppGetActiveDocument();
if (hDoc == 0) {
return;
}
svChannel = "";
hvPage = DocGetAllPages(hDoc, FALSE, FALSE);
for (hPage in hvPage) {
hvData = PageGetAllDatasets(hPage, FALSE);
if (hvData[1] != 0) {
for (hData in hvData) {
svC = DS_GetChannelNames(hData);
if (svC[1] != "") {
svChannel = [svChannel, svC];
}
}
}
}
svChannel = ST_set(svChannel);
ssText = strcat(svChannel, "\n");
hEdit = EdCreate();
EdSetText(hEdit, "Used Channel Names:\n" + ssText);
EdSetModify(hEdit, TRUE);
}
History
Version | Description |
---|---|
R2012.10 | New parameter ssType added. |
5.14.9 | New parameter bOnlyVisible. |
See also
Overview Document Pages, PageGetSelectedDataLayer, GetParent, PageCreate, DocGetAllPages, PageGetAllLayers, LayerGetAllDatasets
id-374603