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 ... 164
Automation Interface, Add-Ins and Tools / Re: How to change icon
« on: June 25, 2009, 08:57:07 am »
Try a shape script like this, it may be what you need:

Code: [Select]
decoration a

The co-ordinates of the rectangle command need to be adjusted to completely hide the icon behind it. I just tested this version on a component and the built-in icon is fully hidden. Obviously, you will want to replace the green rectangle with your own icon. Maybe use the image("imagename",0,0,100,100); command.

By add-in do you mean a MDG one? Looking for clues where to find the relevant help page in order to assess how difficult this is going to be. I'd like to constrain folks to reduce the scope for errors / non-conformity.

Look in the help under "SDK for Enterprise Architect". The two relevant sections are "Enterprise Architect Object Model" and "Enterprise Architect Add-In Model".

I want to constrain things such that View and Viewpoint are related by 'conformsTo'.
If you want to enforce this (disallow any other relationship type between these two element types), you will have to write an add-in. Instructions in the help if you fancy going down that path. Otherwise, you can "make it easy to use the correct relationship type" by defining quicklinks for your profile. Again, instructions in the help.

I'm confused whether a) I need to create a metaclass to represent this relationship
One of the benefits is that it will appear in the Link Type list box for the Relationship Matrix.

and, if so, how to connect the 2 metaclases using it
Quicklinks, Relationship Matrix, Toolbox, all the usual ways.

or, b) whether I just use a standard UML relationship (in which case this seems to be separate from the relationships shown on the Profile Toolbar).
You can put standard (unstereotyped) UML elements in your profile toolbox by defining a custom toolbox profile. Instructions in the help file.

No, tagged values cannot be sorted, they are always in alphabetical order. Probably worth sending in a feature request...

Automation Interface, Add-Ins and Tools / Re: Profile Creation
« on: June 04, 2009, 09:24:44 am »
Go to Settings > UML > Tagged Value Types and create a tagged value type with Type=DateTime;  Give your stereotype class an attribute with the same name as your tagged value type. Save your profile. Create an MDG Technology which bundles your profile and tagged value type definition. Full instructions in the help.

newQueueDiagramObject.Style = oldStyle + "Lollipop = 1;";
I don't know if this is the issue, but there probably shouldn't be any spaces in "Lollipop=1;"

You could export to XMI, very carefully edit the XMI in a text editor, then import it back in again (don't strip GUIDs on the import)

Hi Uffe,

What you have described was the recommended method up until EA 6.5. From EA 7.0, it has been possible to define custom toolboxes as part of an MDG Technology. This is all described in the help file, here:

Regarding Rafael's difficulties, I can't tell what you've done wrong from your description. If you would like to send in a support request to Sparx support, somebody will have a look at it for you. Useful things to send in would include a zipped up copy of the model with your profiles in (or an XMI export of them) and/or a copy of your technology XML file.

Neil :)

At the time EA_OnPreNewElement is called, the element doesn't have a name yet. EA_OnPreNewElement should be used for making "should I allow it to be created or not?" type decisions. Have a look at EA_OnPostNewElement instead which works better for "It's created, how do I make sure it's valid?" type decisions.

Automation Interface, Add-Ins and Tools / Re: Decoration Shape Script
« on: March 31, 2009, 01:12:52 pm »
Attribute settings must appear at the beginning of a shape, so move orientation="NE"; outside the if{}:

Code: [Select]
//Basic Shape
decoration top_right

Automation Interface, Add-Ins and Tools / Re: Create project browser
« on: March 19, 2009, 09:14:22 am »
If the tree structure you're creating is the same every time you run your add-in, you could use EA.Project.ImportPackageXMI().

With an add-in, you can get something working. Search the EA help for 'EA_OnPreNewAttribute'. If you implement this broadcast handler, you can examine the element an attribute is being added to and the stereotype of the attribute being added and either allow or disallow the creation of the attribute.

There is no way in EA to enforce the constraints "A class with stereotype X cannot have operations" or "A class with stereotype X can only have attributes with stereotype Y". However, you can write an add-in to perform model validation and report on violations of the constraints. Search the help for "Model Validation Broadcasts"...

Automation Interface, Add-Ins and Tools / Re: Diagram Import/Export
« on: March 03, 2009, 09:27:31 am »
It's probably hidden in the DiagramLink.Geometry string (which looks like "SX=0;SY=0;EX=0;EY=0;EDGE=3;$LLB=;LLT=;LMT=;LMB=;LRT=CX=101:CY=14:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LRB=;IRHS=;ILHS=;" or the like), but don't ask me what this all means.
Specifically, it will be held in SX,SY for the source and EX,EY for the target (S=start, E=end). I don't know what the values mean, possibly the offset of the centre of the shape (you aim your line at the centre of the shape and attach it at the position where it intersects the edge of the shape).

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