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 - KP

Pages: 1 ... 167 168 [169] 170 171
2521
Automation Interface, Add-Ins and Tools / Re: Quicklinker Broken?
« on: February 28, 2006, 02:46:49 pm »
Quote
I am trying to associate a use case with a functional requirement in a use case diagram.  When I use the quick linker, it automatically connects things with a realization link.

I can confirm that the only link defined between use case and requirement elements is Realization, so the answer to the original question is no, the quicklinker isn't broken.

Quote
The same software installed on our consulatant's machine shows up with a  quick menu giving him an option to choose a link type.

Are you sure you're using the same Requirement element? Issue and Change elements look identical but have extra quicklinks defined. (I don't know why: I'll add it to my list of things to do to investigate)

Quote
Hi Neil,
I guess thee question is more like: "would you let us configure this (like the Perspectives)" than "can you add please this and that".

I've asked and I'm afraid the answer is "probably one day, but not yet".

Neil

2522
Automation Interface, Add-Ins and Tools / Re: Quicklinker Broken?
« on: February 26, 2006, 01:48:55 pm »
Quote
I'm having problems using the quicklinker function.  In the help file, the quicklinker feature is supposed to give me a dialog box to choose the link type... however it just automatically assumes the realize link.  I cannot get it to allow me to use other link types.


The available quicklinker choices depend on the type and stereotype of the source and target elements and in some cases the diagram type. Some source/target/diagram combinations only have a single connector type listed, so that is drawn automatically. What are your source and target elements and what diagram type are you using?

2523
Automation Interface, Add-Ins and Tools / Re: Create new activity diagrams?
« on: February 19, 2006, 01:55:55 pm »
You need to execute the AddNew() method on a Diagrams collection. So for example if you wanted to create an activity diagram beneath an element e:

Code: [Select]

Dim d as EA.Diagram
Set d = e.Diagrams.AddNew("Diagram Name", "Activity")
d.ShowDetails = False  ' or whatever settings you choose
d.Update
e.Diagrams.Refresh


or something like that.

2524
Automation Interface, Add-Ins and Tools / Re: multi selection
« on: February 02, 2006, 03:13:58 pm »
Quote
Hi,
Does anyone know how to access multi-selected elements in project browser using automation interface?

Rgds


Not possible at the moment, I'm afraid. EA.Repository doesn't have the equivalent to the EA.Diagram.SelectedObjects collection, only a GetSelectedObject() method.

2525
In 786, stereotypes on nodes don't display  :( Fixed for 787.

2526
Quote
I'm looking to do things like:
  • add a boundary to a diagram, then add elements to the boundary
  • query a boundary to enumerate the elements it encloses
  • create a hierarchy of nested boundaries

It's easy to identify or add a boundary, but from there I'm lost.


I think you'll need to loop through all of the diagram objects on a diagram and calculate (from the left, right, top and bottom attributes) whether it is fully contained within the boundary.

2527
Quote
Hi,

I wonder if i can use shape scripts also in profiles defined  with the "Profile" toolbox? There is the "Stereotype" element for definition of the new profile's stereotypes, but i can't see a way to attach shape scripts to these stereotypes. Can somebody suggest a way?

Regards (and thanks in advance)
Hermann Pallasch


Hermann,

Give your <<stereotype>> class an attribute named _image and next to the "Initial" value click on the ellipsis (...) button to enter the shape script.

If you want your shape to have a set default size, add attributes named _sizeX and _sizeY and give them initial values (units are pixels) and set the Element Size option on the Save dialog.

HTH

Neil

2528
Automation Interface, Add-Ins and Tools / Re: Add connector to diagram
« on: November 14, 2005, 07:25:51 pm »
EA has a spelling mistake in its internals... Try spelling it "Realisation"  :-[  :-X  :-/

2529
Automation Interface, Add-Ins and Tools / Re: Add connector to diagram
« on: November 10, 2005, 08:48:34 pm »
You don't add connectors to a diagram, you add them between elements:

Code: [Select]

Dim con as EA.Connector
Set con = element1.Connectors.AddNew("Name","Dependency")
con.SupplierID = element2.ElementID
con.Update


Then if both element1 and element2 are on the diagram, you can refresh the diagram and the connector should appear.

HTH

2530
Sorry not to get back to you...

I've not used automation in C# but I'm guessing that EA.ElementClass and EA.RequirementClass appear with auto-completion and are equivalent of EA.Element and EA.Requirement available in VB. If not, it's a problem; if so, don't try to cast to EA.Requirement! Open the properties dialog of a class element in EA and you will see a "Requirement" tab: EA.Requirement is the type of the internal requirement items created on that tab, and is not the type of external requirement elements. They are of type EA.Element.

So, your first attempt without the typecasting is closer to being correct than your second. I think the reason your first attempt doesn't work is you probably need to do the Update and/or Refresh on the collection as well as the element. Try that.

2531
Quote
So, if it's a requirement, I'm trying to cast the element to a RequirementClass.  It won't let me.


How are you trying to cast it? Can you post up a code snippet  please?

And why are you trying to cast it? What do you hope to achieve?

2532
Package.Element contains the properties of the package. You probably need to iterate through the Package.Elements collection. Check the Element.Type property for each item in the collection; this should be "Requirement" for your requirement element.

I don't know C#, but VB6 might be something like:

Code: [Select]
   Dim repos As EA.repository
   Set repos = GetObject(, "EA.App").repository
   
   Dim pack As EA.Package
   Set pack = repos.GetTreeSelectedPackage()
   
   Dim elem As EA.element
   For Each elem In pack.Elements
       If elem.Type = "Requirement" Then
           MsgBox "Found It!"
       End If
   Next

2533
Quote
The part that I am unsure about now is removal.  Will simple using a delete query on the connector do any damage to the rest of the project?


Maybe...

Each connector will have one record in the t_connector table, but may have multiple records in the t_diagramlinks table (one for each diagram it appears on), multiple records in the t_connectortag table, and possibly other information hidden away elsewhere too.

Your best bet is in automation: get the Element at one end or the other and use the Element.Connectors.Delete() or DeleteAt() method. That will guarantee a clean deletion.

Enjoy!

2534
Quote
Is there any simple way to reverse or remove a connector through the repository object?  If not, are there any known issuse with making these changes to the database directly?  I can access the connector I want to reverse, but I can't seem to find the proper call to reverse it.


I think you need swap the values of ClientID and SupplierID and possibly also ClientEnd and SupplierEnd. (nb I haven't tested this so make backups before you try it!)

2535
I haven't had time to test this, but I think for sequence lifelines you need to iterate through the Diagram.DiagramObjects collection, use Repository.GetElementByID(DiagramObject.ElementID) to get the element (which is an instance), and then use Repository.GetElementByID(Element.ClassifierID) to get the instance's classifier.

HTH  :)

Pages: 1 ... 167 168 [169] 170 171