Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: TomO on August 31, 2005, 07:21:06 pm

Title: New C# Add-in Example Released
Post by: TomO on August 31, 2005, 07:21:06 pm
Hi Guys,
Due to the increasing amount of questions regarding the automation interface and its basic functions, I have written another basic example. This one is a C#.Net dll as opposed to a stand alone application (like the last). It explains how to setup VS2003 for debugging and running, also gives you the basic code for connection and menu manipulation; right down to how to setup the registry. If anyone is looking to have a play with EA's automation interface, but doesn't know where to begin I suggest taking a look.
C# How to create a Basic Add-In
http://sparxsystems.com.au/resources/developers/autint.html

Best Regards
Tom O
Title: Re: New C# Add-in Example Released
Post by: vanWeyden on November 14, 2005, 02:11:29 pm
I've built the C# CS_AddinFramework sample DLL (using C# Express for now). EA comes up when I run it, but I don't get a new entry in the EA/Tools menu - not even after doing a Tools/Customize/Menu/Reset.

I think I followed the instructions in the Readme:
-adding Interop.EA.dll to COM references,
reference path, register for COM Interop setting, 'Class library' type (as needed).  I didn't change start application path (didn't see the option) but EA does start so I think it is set.
- setting new registry key [HKEY_CURRENT_USER\Software\Sparx Systems\EA\Addins\CS_AddinFramework]
@="CS_AddinFramework.Main"  where @ is for the '(Default)' name value shown for the key

I also tried copying the DLL to the Sparx Systems\EA directory, and running regasm on it. (This wasn't in the Readme, but was suggested elsewhere) But still no luck.

Hope you can help
Title: Re: New C# Add-in Example Released
Post by: thomaskilian on November 15, 2005, 03:32:11 am
Check that your DLL has been registered correctly. That is: try instancing an object and call EA_Connect.
Title: Re: New C# Add-in Example Released
Post by: vanWeyden on November 15, 2005, 05:15:18 pm
Looks like my problem was I was assuming in regedit that the Registry  Addins key  was

 <...>/Sparx Systems/EA400/EA/Addins

since that existed already.  

After creating <...>/Sparx Systems/EAddins instead, and added my new key to that my Addin now shows up.

The Sparx README file(s) that came with the sample code both said to 'find' the EAAddins key, so maybe my mistake was somewhat understandable, since the key wasn't there at first.

Thanks.
Title: Re: New C# Add-in Example Released
Post by: vanWeyden on November 15, 2005, 06:21:40 pm
Sigh, now it is not working again. I was in & out of C# and regedit etc and guess something got fouled up somewhere again...  But it was working for a while (new Addin top-level, with my Addin in the list).  Not sure what happened...
Title: Re: New C# Add-in Example Released
Post by: thomaskilian on November 16, 2005, 02:23:25 am
Funny, I also had trouble with my Add-In. It worked - not- yes - not - again. Seems to be stable now. Maybe you should shake it a bit more ???