DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to launch a script from a custom button?

Hi nice helpers,

 

I need to implement a functionnality in DIAdem and I think it is possible using scripts but I am not really skilled with scripting and could not realise it completely. I need a button in the toolbar from the DIAdem VIEW tab that would launch whatever is in the VIEW display (grap, table..) to the report but with customized attributes defined in a script. I have the script and was able to create the button but I don't know how to integrate the script call inside the button.

I have used that object to create the button : ActionObjButton

Could someone help me here please? Do you have any exemple of how to do that?

 

Thanks a lot,

Johnny

0 Kudos
Message 1 of 4
(4,643 Views)

I recommend to take a look at the online help / examples in the online help. Under examples for DIAdem 2012 you will find "User-Defined Evaluations in DIAdem ANALYSIS"

I hope this has all the information you need

0 Kudos
Message 2 of 4
(4,636 Views)

Hi Andreas,

 

This helps thanks a lot. But I am still not sure where the script call is done for the button. Could you point it out for me please?

I was able to add a button using the script exemple and I am guessing that oMyActionObj.OnClickCode.Code define what happens when someone click on the button but I don't know what instruction write to replace the popup by a script call, I have done several attempt but could not succeed. As I've mentionned earlier I am not really skilled with the use of scripts.

 

Dim oMyActionObj
If not (BarManager.ActionObjs.Exists("MyButton")) Then
  Set oMyActionObj = BarManager.ActionObjs.Add("MyButton", "CustomButton") 
  oMyActionObj.Picture = "favicon.ico"
  oMyActionObj.Tooltip = "MyButton"
  oMyActionObj.OnClickCode.Code = "Call MsgBoxDisp(""MyButton"")"
Else
  Set oMyActionObj = BarManager.ActionObjs("MyButton")
End If
Call BarManager.Bars("ANAMain").UsedActionObjs.Add(oMyActionObj)

 

Thanks a lot,

 

0 Kudos
Message 3 of 4
(4,622 Views)

Its exactly what you already guessed. You would replace the "Call MsgBoxDisp(""MyButton"")" with a call to ScriptStart. The scriptname has to be in double quotes, exactly like the "MyButton" text in the example

0 Kudos
Message 4 of 4
(4,619 Views)