10-13-2015 10:52 AM
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
10-13-2015 01:07 PM
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
10-14-2015 03:19 AM - edited 10-14-2015 03:21 AM
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,
10-14-2015 03:36 AM
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