Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - fwoolz

Pages: 1 ... 27 28 [29]
421
When retrieving a collection of objects, you can use the ObjectType property (one of the built-in enumerations) to determine the type, then cast the element accordingly. ALWAYS cast to the interface, not the co-class (e.g., EA.Requirement, not EA.RequirementClass); AFAIK, inheritance and COM take care of the rest. I have done this in C# and it works fine.

Cheers,
Fred Woolsey

422
Hello All,

I've been trying out MDG link for VS and encountered a minor glitch. It's minor because it can be overcome using EA's built-in code engineering feature. It's a glitch, however, because it seems the add-in is less tightly integrated with VS than vanilla EA at this point!

Here's the scenario: I have a project connection between VS (C#) and EA. Adding classes in either tool, then synchronizing works just fine. However, when I add a method to an already synchronized class, MDG Link doesn't recognize the need to re-synchronize, so Merge doesn't bring in the new method. However, right-clicking on the class in EA and clicking "Synchronize model" pulls the new method in.

Cheers,

423
Also, if Eclipse is already up and running, I don't get the "...continue waiting?" dialog.

424
Carlos,

I have had this happen as well, but found if you click on "Si" often enough it finally takes.

Cheers,
Fred Woolsey

425
Hi All,

Is there an automatic way to access and manipulate the current element via the Automation Interface in an Add-In?

Thanks,

426
Automation Interface, Add-Ins and Tools / Re: Automation Interface
« on: May 12, 2005, 07:04:51 am »
Kudos to Thomas, "the Little Engine that Could!" Sir Toppemhatt takes his hair off to you!

427
Automation Interface, Add-Ins and Tools / Re: Getting started...
« on: May 03, 2005, 07:12:21 pm »
The 'Tools->References' menu option can be accessed from the Visual Basic window. Open the Visual Basic Editor by selecting 'Tools->Macro->Visual Basic Editor' in Word 2003. Then click 'Tools->References' in the Visual Basic editor. There should be an entry in the dialog box than opens (scroll down) for 'Enterprise Architect Object Model N.NN' (on my machine N.NN is 2.10). Check the box to the left, and the library will be added to the list of checked references shown at the top of the dialog box list.

428
Paolo,

I agree that a cooperative relationship is a great idea. However, I also think we should (pardon the cliche') "let a thousand flowers bloom". Perhaps the Sparxians should sponsor a development group along the lines of some of the Apache groups. Alternatively, this could be centered around the EA User's Group site with Sparxian guidance. In any case,  I think it's a good idea to get a few add-ins that do something useful that could be posted as examples of add-in development.

Cheers,
Fred Woolsey

429
Paolo,

I was thinking of an add-in that provides utility features that aren't currently part of the EA lineup, such as automating creation of a server repository, providing additional database reporting capability (including output documents in XML), stuff along these lines. In addition, it would include useful utilities that augment EA functionality.

The reason for the exercise is twofold: 1) to produce something that's useful to the community and 2) to provide a demo for add-in development in the .NET environment, since the tool would run under .NET 1.1.

Cheers,
Fred Woolsey

430
Hello All,

I'm working on an "EA Toolkit" add-in and am interested in hearing what kinds of utility features the EA community is interested in. So, any and all suggestions are most welcome!

Cheers,
Fred Woolsey

431
Automation Interface, Add-Ins and Tools / Re: C# Plugin
« on: March 03, 2005, 01:11:52 pm »
lario,

I noticed from the registry entries that you're running v 2.0 of the .NET framework...the example on my machine was built with v 1.1 and runs on 1.1. Perhaps EA is not configured to work with .NET 2.0 assemblies (yet)? You might try compiling and installing the example on a machine running both EA and v 1.1 of .NET.

Cheers,
Fred Woolsey

432
Automation Interface, Add-Ins and Tools / Re: C# Plugin
« on: February 23, 2005, 11:59:02 am »
lario,

I had this happen while I was trying to get the EAHelper addin to work. This was due to having the .dll in the wrong directory location, so EA couldn't find the add-in when it tried to load it.

After I built the .dll, I copied it to the EA executable directory, then ran regasm so that it pointed to this location for the .dll. Once I did this, it all worked OK.

Hope this helps!

Cheers,
Fred Woolsey

BTW--I named the .dll "EAHelper.dll", project name EAHelper.

PPS: Here's the relevant registry info:

Registry (.reg) file for entry created by regasm:
===================================================
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{0D53A3E8-E51A-49C7-944E-E72A2064F938}]
@="EAHelper.EAHelper"

[HKEY_CLASSES_ROOT\CLSID\{0D53A3E8-E51A-49C7-944E-E72A2064F938}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{0D53A3E8-E51A-49C7-944E-E72A2064F938}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]

[HKEY_CLASSES_ROOT\CLSID\{0D53A3E8-E51A-49C7-944E-E72A2064F938}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="EAHelper.EAHelper"
"Assembly"="EAHelper, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v1.1.4322"
"CodeBase"="file:///C:/Documents and Settings/Administrator/Desktop/Visual Studio Projects/EAHelper/EAHelper/bin/Debug/EAHelper.DLL"

[HKEY_CLASSES_ROOT\CLSID\{0D53A3E8-E51A-49C7-944E-E72A2064F938}\InprocServer32\1.0.1.0]
"Class"="EAHelper.EAHelper"
"Assembly"="EAHelper, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v1.1.4322"
"CodeBase"="file:///C:/Documents and Settings/Administrator/Desktop/Visual Studio Projects/EAHelper/EAHelper/bin/Debug/EAHelper.DLL"

[HKEY_CLASSES_ROOT\CLSID\{0D53A3E8-E51A-49C7-944E-E72A2064F938}\ProgId]
@="EAHelper.EAHelper"
==================================================
.reg file for Addin:
==================================================
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins]

[HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins\EAHelper]
@="EAHelper.EAHelper"

[HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins\Reports]
@="EADocuments.EaAddin"
==================================================

It's interesting to note that the CodeBase entry still points to the (now non-existent) original location in the Visual Studio project folder, yet the add-in works just fine.  (Note that I added a little functionality since the code was posted originally.) Nevertheless, the add-in is in the same directory as the EA program file itself; this may be a requirement since the assembly was not built with a strong name.

433
OK, so it doesn't do anything but respond to clicks by displaying a MessageBox, but I thought it might be useful to post the code anyway:

Code: [Select]
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using EA;

namespace EAHelper
{

/// <summary>

/// RegisterAddIn

/// </summary>

// Class interface EAHelperInterface

[Guid("EAA4976A-45C3-4BC5-BC0B-E474F4C3C83F")]

public interface EAHelperInterface

{


string EA_Connect(EA.Repository repository);


void EA_Disconnect();


void EA_FileOpen(EA.Repository repository);


string EA_GetMenuItems(EA.Repository repository, string menulocation, string menuname);


void EA_MenuClick(EA.Repository repository, string menuname, string menuitem);

}


// Events interface EAHelperEvents

[Guid("7BD20046-DF8C-44A6-8F6B-687FAA26FA71"),

InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

public interface EAHelperEvents

{


}


// Class EAHelper

[Guid("0D53A3E8-E51A-49C7-944E-E72A2064F938"),

ClassInterface(ClassInterfaceType.None),

ComSourceInterfaces(typeof(EAHelperEvents))]

public class EAHelper : EAHelperInterface

{


public string EA_Connect(EA.Repository repository)


{



return null;


}



public void EA_Disconnect()


{


}



public void EA_FileOpen(EA.Repository repository)


{


}



public string EA_GetMenuItems(EA.Repository repository, string menulocation, string menuname)


{



return "&EAHelper";


}



public void EA_MenuClick(EA.Repository repository, string menuname, string menuitem)


{



System.Windows.Forms.MessageBox.Show("Add-In Menu Clicked");




}


}
}


Note also that the add-in is placed in the same directory as the EA executable, and registered with "regasm.exe".  I haven't experimented with placing the .dll elsewhere, but the .NET help makes some noises about requiring a strong name...not hard to do using "sn.exe", but I just haven't bothered trying it yet.  First things first...

Cheers,
Fred Woolsey

434
Cheers Ben,

BINGO!!! Works like a charm.  Once I get the some basic functionality (beyond showing up on the menu and responding to clicks), I'll post the code.  Thanks!

FCW

435
Tim,

I'm also working on C# add-ins and have had similar results, albeit with the registered version 4.51.744 (same thing seems to be the case with build 747).  I'd be interested in hearing how things turn out.

Cheers,
Fred Woolsey

Pages: 1 ... 27 28 [29]