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 ... 152 153 [154] 155 156 ... 166
2296
Automation Interface, Add-Ins and Tools / Re: Diagram Communication
« on: February 04, 2010, 08:45:33 am »
From the "Interaction" toolbox (the one used with sequence diagrams) you could use the "Endpoint" or "Diagram Gate" element as the source of the message.

2297
Quote
We need to do a few things with customizing the UI, First, we would like to add a couple links to the context menu of items and packages we have created using our Add-In. For all elements or packages created using our add-in, we would like to create a couple menu items, so that when you right-click on the element or package, you get some direct items in the context menu.
The Add-Ins menu from EA's main menu gets reproduced in the context menu, but that's the closest you can get I'm afraid.

Quote
Also, we would like to put a small icon in the browser on imported packages to denote that they are packages that have been imported by our add-in.
In the help, look up supported stereotype attributes in UML profiles. The attribute you need to define is "icon".

2298
A shape script can't query its element's size, but you can use the defSize(x,y); command to set the size. Units are pixels at 100% zoom. Example:

shape main
{
    defsize(50,50);
    ellipse(0,0,100,100);
}

will create a circle not an oval.

2299
Automation Interface, Add-Ins and Tools / Custom Compartments
« on: December 23, 2007, 05:15:39 pm »
Hi All,

I've been having a go at creating custom compartments. Here's some code (VB.Net) that seems to work - it creates a deployed artifacts compartment for node elements...
Code: [Select]

Function EA_QueryAvailableCompartments(ByVal Repository As EA.Repository) As Object
   EA_QueryAvailableCompartments = "deployed artifacts"
End Function

Function EA_GetCompartmentData(ByVal Repository As EA.Repository, ByVal sCompartment As String, ByVal sGUID As String, ByVal oType As EA.ObjectType) As Object
   If Repository Is Nothing Then
       EA_GetCompartmentData = ""
       Exit Function
   End If

   Dim el As EA.Element
   el = Repository.GetElementByGuid(sGUID)

   Dim sData As String = ""
   Dim sCompartmentData As String = ""

   If el.Type = "Node" Then
       Dim con As EA.Connector
       For Each con In el.Connectors
           If con.SupplierID = el.ElementID Then
               If (sCompartment = "deployed artifacts" And con.Type = "Deployment") Then
                   Dim art As EA.Element
                   art = Repository.GetElementByID(con.ClientID)
                   If art.Type = "Artifact" Then
                       sData = sData + "Data&_eq_^" + art.Name + "&_sc_^"
                       sData = sData + "GUID&_eq_^" + art.ElementGUID + "&_sc_^,"
                   End If
               End If
           End If
       Next

       If sData <> "" Then
           sCompartmentData = sCompartmentData + "Name=" + sCompartment + ";"
           sCompartmentData = sCompartmentData + "OwnerGUID=" + sGUID + ";"
           sCompartmentData = sCompartmentData + "Options=SkipIfOnDiagram&_eq_^1&_sc_^"
           sCompartmentData = sCompartmentData + "CompartmentData=" + sData + ";"
       End If
   End If
   EA_GetCompartmentData = sCompartmentData    
End Function

Happy holidays,

Neil

2300
Automation Interface, Add-Ins and Tools / Re: Custom QuickLink Problems
« on: January 12, 2010, 09:20:21 am »
You don't want to use fully-qualified stereotypes: Say "mofsdmObject" not "MOFSDMElements::mofsdmObject".

2301
Automation Interface, Add-Ins and Tools / Re: Custom QuickLink Problems
« on: January 12, 2010, 08:55:17 am »
Your document artifact named QuickLink has to be saved as part of a UML Profile. If you think you've done this, just check by opening your profile file in a text editor and looking for a <QuickLink> section towards the end of the file. The UML Profile can then be imported into your model or deployed as part of an MDG Technology.

2302
It needs to be the technology ID, not name. If you open your technology XML file in a text editor, you will see the ID on the second line.

2303
The way I would do this is: create a document artifact on a diagram and give it a linked document containing your template, save the diagram as a UML Pattern, include the UML Pattern in your MDG Technology, add an item to your custom toolbox to drop the UML Pattern onto a diagram. Instructions in help file. HTH.

2304
It doesn't look like it can be done using the automation interface. Please send in a bug report and hopefully somebody can add it.

In the meantime, if you can establish a SQL connection to your model you can set it directly in the database. The field you would need to change is t_diagramobjects.ObjectStyle which contains a set of properties including "VPartition=0;" for horizontal partition (the default) or "VPartition=1;" for vertical.

2305
There aren't any commands to, for example, create a profile from a given diagram/package or create a technology from a given MTS file (good ideas for a feature request), so you would have to write your own XML serialization. If you do, the potential sticking point will probably be base-64 encoding of shape scripts and bitmaps - I can't help you there, no idea how it's done.

2306
Quote
Yes,

But was not the question if it possible to hide symbols when exporting them? At least I want to show them on screen but when exporting removing certain elements.

// Magnus
Select the elements you want to appear in your diagram (hold down Ctrl and click the ones to select) then press Ctrl+C to copy the selected elements to the clipboard. Open a graphics application (MS Paint will do) and paste the clipboard into a new diagram. HTH

2307
You can define a stereotype «invisible» that applies the following shape script:

Code: [Select]
shape main
{
}
If you set the stereotype's base class to '<all>' you can apply it to any element.

Regarding EA crashing, this needs investigating so please send in a bug report. Thanks.

2308
Automation Interface, Add-Ins and Tools / Re: Toolbox Help
« on: December 04, 2009, 10:01:41 am »
Quote
Hi,

No joy in fixing this yet...

Can a kind soul please post a simple example of a stereotype extending a metaclass that successfully drags from the toolbox?

TIA,
Paolo
Have a look in C:\Program Files\Sparx Systems\EA\MDGTechnologies. There's lots of examples in there.

Looking at your XML snippet, ProgrammeModelling is the name of your toolbox profile. Is it also the name of the UML Profile which contains the ZZZB stereotype?

2309
Quote
As far I remember this was the thingey I didn't get to work. I've tried various versions for PPP and SSS, with full stereotype namespace, without, etc. But maybe I've just missed something. At least I ended up implementing the mentioned synch code, and that worked well.

WBR
Günther
If you were taking it from this post it is missing a semi-colon after the stereotype. Maybe that was the problem?

2310
The answer is buried deep in one of the links that Günther gave you:
Code: [Select]
Repository.CustomCommand("Repository", "SynchProfile", "Profile=PPP;Stereotype=SSS;");
What this will do is search for all elements in the database with the stereotype «SSS» from profile "PPP" and bring their list of tagged values up-to-date. So if you are adding several stereotyped elements, just run this command once at the end.

Pages: 1 ... 152 153 [154] 155 156 ... 166