Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Steve Wartik on February 28, 2012, 08:47:23 am

Title: Add menu to execute script
Post by: Steve Wartik on February 28, 2012, 08:47:23 am
Hi,

I've written some JScript code. I'd like the user to be able execute it through a menu. Specifically, I'd like to add a menu hierarchy to Extensions. Just like the ODM-related menu items, a script would be executed each time the user selects an item. Can someone tell me how to do this? Thanks.
Title: Re: Add menu to execute script
Post by: Geert Bellekens on February 28, 2012, 05:27:59 pm
I would make an add-in.
See Tutorial: Create your first C# Enterprise Architect addin in 10 minutes (http://geertbellekens.wordpress.com/2011/01/29/tutorial-create-your-first-c-enterprise-architect-addin-in-10-minutes/)

Geert
Title: Re: Add menu to execute script
Post by: Steve Wartik on February 29, 2012, 12:28:23 am
Geert,

An add-in is certainly a possibility, but I was hoping to package and distribute the capability I've developed using MDG. In other words, I'd like a user to select the Tools>MDG Technology Import item, load the file I'm distributing, then see my menus. I would prefer that the user not have to install an add-in too. Is that feasible?

Thanks,

Steve
Title: Re: Add menu to execute script
Post by: Geert Bellekens on February 29, 2012, 12:32:08 am
I don't know.
I've never used MDG before.

Geert
Title: Re: Add menu to execute script
Post by: Eve on February 29, 2012, 08:49:33 am
Unfortunately, you can't add scripts from your technology into that menu. ODM has been explicitly added by Sparx.
Title: Re: Add menu to execute script
Post by: Steve Wartik on February 29, 2012, 09:29:53 am
Simon,

Thanks for the definitive response. Obviously not what I wanted to hear. Can I write an add-in that invokes JScript?

Thanks,

Steve
Title: Re: Add menu to execute script
Post by: stao on February 29, 2012, 11:01:15 am
for which reason?
you can create an addin which does exactly the stuff you need.
no need for jscript.
Title: Re: Add menu to execute script
Post by: Steve Wartik on March 01, 2012, 12:30:10 am
Well, the immediate reasons are: 1) I already have the JScript working; 2) I've never programmed in C#, I dislike Visual Basic, etc. In other words, I'm guessing that making use of my existing scripts would be quickest.
Title: Re: Add menu to execute script
Post by: stao on March 01, 2012, 02:03:06 am
If you programmed in java you wont have any problems using C#
(i for myself started to develop an EA Addin withouth any C# experiences and it never was a problem)

If the jscripts dont do what they should i dont see any other possibilities than start a C# addin.
Its worth a try.
Title: Re: Add menu to execute script
Post by: Steve Wartik on March 03, 2012, 01:33:06 am
Stao,

Okay, I'll give it a try. I hope you're right about Jave -> C#. Wish me luck!