DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete a curve in a report with GraphObjDelete?

Hello!

I have a problem with deleting curves from a report. (Diadem 10.0, Windows XP, english)

But first something working:

Call GraphObjNew("Freetext","Text1")
Call GraphObjOpen("Text1")
     TxtTxt ="Test"
     TxtSize =20
     TxtColor ="red"
     TxtPosX =50
     TxtPosY =50
Call GraphObjClose("Text1")

Call GraphObjDelete("Text1")


I create a text and afterwards I can delete it.

Now my problem:
I have written a bunch of dialogs, where I can setup a report (select data, colors,..), export as pdf, setup the next one and so on.
Sometimes I need to delete a curve which I tried like in the following sample-code:

Call GraphObjNew("2D-Axis","2DAxis1")
Call GraphObjOpen("2DAxis1")
  D2AXISBOTTOM     =20
  D2AXISLEFT       =20
  D2AXISTOP        =20
  D2AXISRIGHT      =20
  Call GraphObjNew("2D-Curve","testcurve")
  Call GraphObjOpen("testcurve")
    D2CCHNXNAME      ="[2]/PP"
    D2CCHNYNAME      ="[2]/ETAP"
  Call GraphObjClose("testcurve")
  ' :
  ' :
  ' :
  Call GraphObjDelete("testcurve")

Call GraphObjClose("2DAxis1")

I get the following error in the line of the
GraphObjDelete:
Object layer (testcurve) already open.
You have tired to open a new object on a layer that is already open.

What is my mistake, why is it working with the text but not with the curve and what is it, the errormessage tries to tell me?
Maybe somebody can help me.

thanks
josef

Message Edited by steinmassl on 04-11-2006 05:23 PM

0 Kudos
Message 1 of 2
(3,146 Views)

Hi Josef

The command GraphObjDel is only to delete "main object".

To delete a curve you have to assign an empty string to the x and y value:

Call GraphObjNew("2D-Axis","2DAxis1")
  Call GraphObjOpen("testcurve")
    D2CCHNXNAME      =""
    D2CCHNYNAME      =""
  Call GraphObjClose("testcurve")
Call GraphObjClose("2DAxis1")

Hope this helps

Winfried

0 Kudos
Message 2 of 2
(3,129 Views)