From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a legend with VBS

Hi,
if I want to create an Textbox with VBS in a presentation, I can use this Code:
 
Call GRAPHObjNew("FreeText","Text1")
   Call GRAPHObjOpen("Text1")
       TXTTXT   = "..."
       TXTFONT  = "Arial"
       TXTSIZE  = 4
       TXTCOLOR = "black"
       TXTPOSX  = 50
       TXTPOSY  = 95
       TXTRELPOS= "cent."
  Call GRAPHObjClose("Text1")
 
Wich Code can I use to Create an Legend in an 2D-Axis Object?
 
 
0 Kudos
Message 1 of 3
(3,345 Views)

Hello Johannes

I assume you have a 2D-Axis system.

The easiest way to get the script you ask for is to press <CTRL-A> when you open the dialog box where you can make the setting. Then the complete structure will be recorded and can be insert in your script from the clipboard (or directly in the script if you start the recoding mode of DIAdem)

If you have a Axis-system with the name "2D-Axis1", then use the following script to create a "free legend". For more parameters record the script and press F1 for more details about the variable.

Call GraphObjOpen("2D-Axis1")
  '------------------- Swith legend on -------------------------------
  D2LEGDRAW        =1

  D2LEGTXTTYPE     ="Free text" ' "ChannelName" or other keywords
  D2LEGTXTFREE     ="My free legend"

Call GraphObjClose("2D-Axis1")
'redraw
Call Picupdate()

Hope this helps

Winfried

0 Kudos
Message 2 of 3
(3,336 Views)
Thanks a lot.
 
Simply D2LegDraw=1.
 
I thought I have to create a new Object
0 Kudos
Message 3 of 3
(3,334 Views)