DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Import data channel after PicLoad

Hi everyone,
 
After loading a TDR file I want to construct a script for loading data channels into the existing axis systems in the report automatically. Maybe the command like "GraphObjNew" doesn't help in this situation. Is there any command that can solve this question?
 
Thanks in advance.
 
Zhiyao
0 Kudos
Message 1 of 8
(5,024 Views)

Hello Zhiyao!

Assuming you want to analyse the TDR to determine wich channels to load this code will show how to loop through the objects to get the names:

Option Explicit
 
Dim nPicObj
Dim nCurve
 
For nPicObj=1 To ReportObjLast
  If PicObj(nPicObj) <> "" Then
    If PicObjType(nPicObj) = "XY" Then
      Call GraphObjOpen(PicObj(nPicObj))
 
      For nCurve=1 To CurveIdentNoMax
        If D2CurveObj(nCurve)<>"" Then
          MsgBox "X: " & D2ChnXName(nCurve) & vbCRLF & "Y: " & D2ChnYName(nCurve)
        End If
      Next
      Call GraphObjClose(PicObj(nPicObj))
    End If
  End If
Next

This simple example only work with 2D axis and normal curve type. The code have to be expanded for other object or curve types.

BTW: This is the basic aproach for data loading in our DIAdem application framework X-Frame.

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 8
(5,020 Views)
Thanks Matthias
 
Now I come across a problem when configurating y2 axis parameters manually. I use "manual" for scaling mode and set Begin: 0, End: 90, Tick interval: 30. But DIAdem automatically changes my setting into Begin: 0, End: 150, Tick interval: 50. I don't know why. Is there any methods to solve this problem?
Download All
0 Kudos
Message 3 of 8
(4,983 Views)
Hello Zhiyao!
 
I tried it in a DIAdem 10.2.1f3219 and it was OK.
 
Can you please press Ctrl+A in the axis configuration dialog and paste the clipboard content into a new reply.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 8
(4,980 Views)
Due to character limit I just post the y-axis configuration.
 
'------------------- Curve and axis definition ---------------------

  '------------------- Y scala ----------------------------------
  Call GraphObjOpen("2DYAxis1_1")
    D2AxisYDivMode   ="linear"
    D2AxisYScaleType ="manual"
    D2AxisYBegin     =0
    D2AxisYEnd       =2250
    D2AxisYOrigin    =0
    D2AxisYSpanWidth =2250
    D2AxisYTickDist  ="calculated from tick space"
    D2AxisYTick      =750
    D2AxisYTickChn   =0
    D2AxisYMiniTick  =0
    D2AxisYTickType  ="left"
    D2AxisYTickChnN  =""
    D2AxisYNoCurClip =0
    D2AxisYTickAuto  =1
    D2AxisYTickSize  =1
    D2AxisYTickBegin =0
    D2AxisYInScal    =1
    D2AxisYUnitAuto  =1
    D2AxisYUnitPerCm =25
  Call GraphObjClose("2DYAxis1_1")
  '------------------- Y numbers --------------------------------
  Call GraphObjOpen("2DYAxis1_1")
    D2AxisYFormat    =""
    D2AxisYAng       =0
    D2AxisYRelPos    ="left"
    D2AxisYFont      =""
    D2AxisYSize      =3
    D2AxisYColor     ="blue"
    D2AxisYColorRGB  =50266112
    D2AxisYAutoColor =0
    D2AxisYBold      =0
    D2AxisYItal      =0
    D2AxisYUndl      =0
    D2AxisYStrOut    =0
    D2AxisYFrame     =0
  Call GraphObjClose("2DYAxis1_1")
  '------------------- Y axis text ------------------------------
  Call GraphObjOpen("2DYAxis1_1")
    D2AxisYTxt       ="[N*m]"
    D2AxisYTxtSize   =3
    D2AxisYTxtFont   =""
    D2AxisYTxtColor  ="blue"
    D2AxisYTxtColRGB =50266112
    D2AxisYTxtAutoCo =0
    D2AxisYTxtAng    =90
    D2AxisYTxtRelPos ="manual"
    D2AxisYTxtDeltaX =-6.21
    D2AxisYTxtDeltaY =98.56
    D2AxisYTxtBold   =0
    D2AxisYTxtItal   =0
    D2AxisYTxtUndl   =0
    D2AxisYTxtStrOut =0
    D2AxisYTxtFrame  =0
  Call GraphObjClose("2DYAxis1_1")
  '------------------- Y scala ----------------------------------
  Call GraphObjOpen("2DYAxis1_2")
    D2AxisYDivMode   ="linear"
    D2AxisYScaleType ="manual"
    D2AxisYBegin     =0
    D2AxisYEnd       =90
    D2AxisYOrigin    =0
    D2AxisYSpanWidth =90
    D2AxisYTickDist  ="calculated from tick space"
    D2AxisYTick      =50
    D2AxisYTickChn   =0
    D2AxisYMiniTick  =0
    D2AxisYTickType  ="right"
    D2AxisYTickChnN  =""
    D2AxisYNoCurClip =0
    D2AxisYTickAuto  =1
    D2AxisYTickSize  =1
    D2AxisYTickBegin =0
    D2AxisYInScal    =1
    D2AxisYUnitAuto  =1
    D2AxisYUnitPerCm =25
  Call GraphObjClose("2DYAxis1_2")
  '------------------- Y numbers --------------------------------
  Call GraphObjOpen("2DYAxis1_2")
    D2AxisYFormat    =""
    D2AxisYAng       =0
    D2AxisYRelPos    ="right"
    D2AxisYFont      =""
    D2AxisYSize      =3
    D2AxisYColor     ="blue"
    D2AxisYColorRGB  =50266112
    D2AxisYAutoColor =0
    D2AxisYBold      =0
    D2AxisYItal      =0
    D2AxisYUndl      =0
    D2AxisYStrOut    =0
    D2AxisYFrame     =0
  Call GraphObjClose("2DYAxis1_2")
  '------------------- Y axis text ------------------------------
  Call GraphObjOpen("2DYAxis1_2")
    D2AxisYTxt       ="[km/h]"
    D2AxisYTxtSize   =3
    D2AxisYTxtFont   =""
    D2AxisYTxtColor  ="blue"
    D2AxisYTxtColRGB =50266112
    D2AxisYTxtAutoCo =0
    D2AxisYTxtAng    =90
    D2AxisYTxtRelPos ="right"
    D2AxisYTxtDeltaX =7
    D2AxisYTxtDeltaY =100
    D2AxisYTxtBold   =0
    D2AxisYTxtItal   =0
    D2AxisYTxtUndl   =0
    D2AxisYTxtStrOut =0
    D2AxisYTxtFrame  =0
  Call GraphObjClose("2DYAxis1_2")
  '------------------- Position ---------------------------------
  D2AxisBottom     =87.98
  D2AxisLeft       =7.46
  D2AxisTop        =4.67
  D2AxisRight      =8.65
Call GraphObjClose("2DAxis1")


By the way, in the "Y scala", the recorded D2AxisYTick = 50. But in fact my setting is 30. That's weird.
0 Kudos
Message 5 of 8
(4,978 Views)

Hello Zhiyao!

The scaling is as expected in my DIAdem. Can you please check your version.

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 6 of 8
(4,968 Views)
My version is DIAdem 10.2.0f3031
 
Thank you for your help Matthias.
0 Kudos
Message 7 of 8
(4,965 Views)
Hello Zhiyao!
 
Can you install the latest SP and try again? The latest version is 3219. The SP is a full installation so DIAdem will force you to deinstall your current version first Smiley Sad
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 8 of 8
(4,963 Views)