Showing results 1 to 2 of 2

Thread: Help, please, how I can delete a curve in ETM using VBA?

  1. #1
    Join Date
    29.11.2013
    Posts
    4

    Default Help, please, how I can delete a curve in ETM using VBA?

    Hello,

    Using this example I can create curves by VBA. But I don't know how to delete a curve. Help, please, how I can delete a curve using VBA?

    'Create Function for TREND - PICTURE
    Sub CreateTrendFunction()
    Dim zPIC As DynPicture
    Dim zFCT As RtFunction
    Dim i As Integer

    Set zPIC = MyWorkspace.ActiveDocument.DynPictures.Item("TREND")
    'Create new function
    Set zFCT = MyWorkspace.ActiveDocument.RtFunctions.Create("picTREND", tpPicture)
    'function settings...
    With zFCT
    .DynProperties("Picture") = zPIC.Name
    i = .DynProperties("PictFilter[-1]")
    If i = 0 Then .CreateDynProperty "PictFilter"
    .DynProperties("PictFilter[0].RefreshRate") = 1
    .DynProperties("PictFilter[0].Name") = "WIZARD TREND"
    .DynProperties("PictFilter[0].IsArchive") = False
    .DynProperties("PictFilter[0].IsXAxis") = False
    'Add 3 CURVES
    For i = 0 To 2
    n = .DynProperties("PictFilter[0].Curve[-1]")
    If n <= i Then
    'create CURVE SubItem if needed
    .CreateDynProperty ("PictFilter[0].Curve")
    .CreateDynProperty ("PictFilter[0].Curve[" & i & "].VarInfo")
    .CreateDynProperty ("PictFilter[0].Curve[" & i & "].YAxe")
    .CreateDynProperty ("PictFilter[0].Curve[" & i & "].YAxe[0].Scale")
    End If
    'change curve settings
    .DynProperties("PictFilter[0].Curve[" & i & "].GraphName") = "MyVariable_" & i
    .DynProperties("PictFilter[0].Curve[" & i & "].HasYAxis") = True
    .DynProperties("PictFilter[0].Curve[" & i & "].IsShow") = True
    .DynProperties("PictFilter[0].Curve[" & i & "].IsInterpolation") = True
    .DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.VarName") = "MyVariable_" & i
    .DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.Channel") = "MyVariable_" & i
    .DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.Variable") = "MyVariable_" & i
    .DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.VarMaxValue") = 1000
    .DynProperties("PictFilter[0].Curve[" & i & "].VarInfo.VarMinValue") = 0
    .DynProperties("PictFilter[0].Curve[" & i & "].YAxe.IsAutoScale") = False
    .DynProperties("PictFilter[0].Curve[" & i & "].YAxe.Color") = vbBlack
    .DynProperties("PictFilter[0].Curve[" & i & "].YAxe.Scale.ScaleTop") = 1000
    .DynProperties("PictFilter[0].Curve[" & i & "].YAxe.Scale.ScaleBotton") = 0
    Next i
    'filter settings (relative time 5 minutes)
    .CreateDynProperty ("PictFilter[0].TimeAxe")
    .DynProperties("PictFilter[0].TimeAxe.OldDiff") = 3600
    .DynProperties("PictFilter[0].TimeAxe.TimeFilter.Options") = 65535
    .DynProperties("PictFilter[0].TimeAxe.TimeFilter.ARVTime1") = CDate(25569.0451388889) '("01.01.1970 01:05:00")
    .DynProperties("PictFilter[0].TimeAxe.TimeFilter.ARVTime2") = CDate(25569.0416666667) '("01.01.1970 01:00:00")
    End With
    End Sub

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Help, please, how I can delete a curve in ETM using VBA?

    Please check out this thread: http://www.copadata.com/forums/showthread.php?t=1006

    regards,
    herbert


Similar Threads

  1. Curve name an axis titles
    By sbc in forum zenon Supervisor
    Replies: 1
    Last Post: 5th September 2013, 07:24
  2. Delete structured tag
    By fabios in forum VBA
    Replies: 8
    Last Post: 28th July 2008, 14:39
  3. Delete item in a combobox
    By fabios in forum VBA
    Replies: 2
    Last Post: 11th July 2008, 10:43

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •