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 ... 26 27 [28] 29
BTW Redux -

After a think, I realized that it makes perfect sense that DiagramObject <> Element, since a single Element can appear on 0..* diagrams. DOH!! My bad.

BTW - Here's the code that finally got me what I wanted in the first place:

EA.Package pkg = currrep.GetPackageByID(currelem.PackageID);
EA.Element nelem = (EA.Element) pkg.Elements.AddNew(currelem.Name + i.ToString(), currelem.Type);
EA.DiagramObject nobj = (EA.DiagramObject)currdiag.DiagramObjects.AddNew(currelem.Name + i.ToString(), currelem.Type);
nobj.ElementID = nelem.ElementID;

I still need to go back and remove the redundant name and type definitions, but it works.

Thanks again for your help!

That's it!!!

Thanks for the quick reply. I will note, however, that this isn't well-documented in the EA help files...

Fred W

I recall encountering this problem a long time ago when I was more active in tinkering with add ins, and I seem to remember getting around it, but...

Here is the offending code (C#):

EA.Element nelem = (EA.Element)(currdiag.DiagramObjects.AddNew(currelem.Name + i.ToString(), currelem.Type));

The error:

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.Element'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{20073882-CCA7-4E64-BE9C-D381216A4225}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

In the above, currelem is an EA element passed to the method in which the offending line appears, currdiag is the current diagram, and i is an index appended to the name of the current element.

Further info:
EA: 7.5 build 845
VS 2008
.NET 3.5 SP1


Hi Carlitos,

In EA Options, click Links, then check the box marked 'Show Uses arrowheads'.


Automation Interface, Add-Ins and Tools / Re: Add-Ins using .NET 2.0
« on: September 05, 2006, 06:25:48 pm »

As Emily Litella of SNL famously said, "Never mind!" Add-ins in .NET 2.0 work just fine. I had forgotten that the registry key for the add-in needs to have the same name as the VS Solution file. Once I fixed that, it worked w/o a problem.


Automation Interface, Add-Ins and Tools / Add-Ins using .NET 2.0
« on: September 04, 2006, 10:57:55 am »

Are there any known problems implementing EA add-ins using v 2.0 of the .NET framework?


Automation Interface, Add-Ins and Tools / Profile Woes
« on: August 16, 2006, 03:54:05 pm »
Hello All,

The behavior of <<redefines>> and <<extends>> in UML profiles is inconsistent. In some cases (e.g. connectors), EA 6.1 wouldn't carry attributes over as tagged values once the saved profile was imported into EA unless the connector metaclass was redefined (extend didn't work). In EA 6.5 Beta 1, it seems even redefinition doesn't work--attributes defined in the profile don't show up as tags when the imported profile element is placed in a diagram. Similar behavior was noted in 6.1 with events.


Automation Interface, Add-Ins and Tools / Merge Nodes and Regions
« on: August 15, 2006, 04:04:45 pm »

This isn't specifically an automation interface issue, but it arose while working on an add-in to process activity diagrams into code, simulations, scenario text, etc. For some regions, Merge Nodes (and possibly Decision Nodes) in Regions don't take the Region ElementID as their ParentID (other elements do, e.g. Actions). In addition, attempting to move a Merge Node under a Region yields an error message. Why is this?


Thanks...tried it and it works OK!

Still, the perfectionist in me says the glitch with GetByName() should be fixed. Also, the Automation Interface documentation could use an editorial review for completeness?

EA is a fantastic would be a shame if someone were to be put off by a minor glitch like the one discussed.


Hello All,

It seems that, while casting Element.TaggedValues.GetAt(x) to TaggedValue works fine, trying the same with Connector.TaggedValues throws a COM invalid cast exception. In addition, Connector.TaggedValues.GetByName(name) always seems to throw an OLE exception, yet GetByName() works fine for an Element.


Automation Interface, Add-Ins and Tools / Re: Add-In and new beta
« on: November 09, 2005, 06:09:54 pm »

As Bugs Bunny useta say, "'s a possibility!" I'm running Win 2K & haven't tried it on an XP machine yet.

Automation Interface, Add-Ins and Tools / Re: Add-In and new beta
« on: November 09, 2005, 08:07:20 am »

I'm running a .NET add-in just now that I spliced in under EA 5.0 and it works just fine after installing EA 6.0 Beta 2. The add-in link is just where it was prior to installing 6.0 @ HKCU_Software_Sparx Systems_EAAddins. There is an "Addins" folder under HKCU_Software_Sparx Systems_EA400_EA, but that's currently empty on my machine.

Fred Woolsey


'Swhat I thought as well, but when I try it nothing happens. The object isn't selected in the Project View, and I get no error message. Is this a *NYFIF?

* Not yet fully implemented feature

Fred Woolsey


Can anyone clarify the usage for the Repository.ShowInProjectView(Object) method? I didn't see anything in the help file, but snooping in EA.tlb shows a help string stating "Show an object in the tree view." I've tried calling it, passing an element as the parameter, but it seems to do nothing (at least it doesn't crash my .NET add-in).

Fred Woolsey

Pages: 1 ... 26 27 [28] 29