‎04-17-2018 09:13 AM
How to drag and drop multiple groups to the VIEW 2D axis system? I have an internal data with 80 groups, each has two channels: time (x-axis) and temperature (y-axis). I can drag and drop them one by one but can't in a batch 😕
‎04-17-2018 03:02 PM
To determine how to do something in DIAdem use two steps
Based on your last forum entry I created this script
Option Explicit
Call View.NewLayout()
View.Sheets(1).Areas(1).DisplayObjType = "CurveChart2D"
Dim oDisplayObj
Set oDisplayObj = View.Sheets("Sheet 1").Areas("Area : 1").DisplayObj
oDisplayObj.AxisLabeling = true
oDisplayObj.YScalingMode  = "automatic"
' assume we have a group of x/y channels stored in a group one after another
dim grpO : set grpO = data.Root.ChannelGroups(1)
' There might be some leading channels that do not need to be plotted like an index
dim channelPairOffset : channelPairOffset = 0
if "Item" = grpO.Channels(1).name then
  channelPairOffset = 1
end if
dim i
for i = 0 to ((grpO.Channels.Count - channelPairOffset)/2) - 1
  ' add curves to view by using x and y channel
  dim xChannelRef : xChannelRef = grpO.Channels(channelPairOffset + i*2 + 1).GetReference(eRefTypeIndexName)
  dim yChannelRef : yChannelRef = grpO.Channels(channelPairOffset + i*2 + 2).GetReference(eRefTypeIndexName)
  call oDisplayObj.Curves2D.Add(xChannelRef, yChannelRef)
Next
which will add x/y channels pairs from a single group to view.
Its is easy to modify to multiple groups but I would still suggest to put the channels in one group to make handling easier because DIAdem has no explicit X channels.
Just drag and drop a bunch of channels into View will plot them using the first selected channel as x-Channel which will result into the same as dragging a group with two channels where the x-Channel must be the first channel.
After creating such a View Layout you can just save it and just press Refresh after loading a new data file.
‎04-18-2018 02:38 AM
I cannot use the first channel as x-axis since every data channel (y) has its own timestamps (x). In another word, x is not common for all y.
‎04-18-2018 05:02 AM - edited ‎04-18-2018 05:04 AM
You do not have to use the first one.
oDisplayObj.Curves2D.Add(xChannelRef, yChannelRef)
always uses a pair of channels but it does not matter where they are stored.
You can even use x channel from another group.
Just try the script in combination of the plugin of the other thread.
DIAdem Content of CSV file