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 ... 154 155 [156] 157 158 ... 168
2326
Quote
I just realized that the EA_OnPostNewDiagramm event doesn't occur after a Diagram has been created, but an object within a diagram, so I am now without a clue how to add standard elements to a diagram on it's creation.
:(
That sounds like you are using EA_OnPostNewDiagramObject. EA_OnPostNewDiagram should do exactly what you want it to do. This is what the help claims:
Quote
EA_OnPostNewDiagram notifies Add-Ins that a new diagram has been created. It enables Add-Ins to modify the diagram upon creation.
If that isn't happening then please send in a bug report with a code sample. Thanks.

2327
Quote
Look for parentedge in the help file.  It doesn't say what the possible values are, but you can work it out fairly quickly by printing it and then moving a port around.
"Right", "Left", "Top" and "Bottom"

2328
No, the ID isn't unique across all types.

2329
Repository.CustomCommand("Repository", "SynchProfile", "Profile=MyProfile;Stereotype=MyStereotype;")

2330
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.

2331
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".

2332
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.

2333
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

2334
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".

2335
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.

2336
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.

2337
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.

2338
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.

2339
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.

2340
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

Pages: 1 ... 154 155 [156] 157 158 ... 168