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 ... 4 5 [6] 7 8 ... 167
But there's no way to check for the element's 'direction' in a shape script -- it doesn't have its own property for retrieval, and it's not a tagged value.

This works...
Code: [Select]
shape main

There's no need to guess. The property names are all documented in the manual; you just have to read it.


Correct. I've just checked it's neither "ID" nor "DiagramID".

It's a long time since I wrote an add-in, but I don't think you're going to be passed a DiagramID in the EventProperties of EA_OnPostNewElement. Try getting the size of the EventProperties then loop through with Get(index) and see what's there - more reliable than guessing the property names.

EA will send out broadcasts when certain actions take place, so you need to create functions that respond to those broadcasts. For example, to respond to a new element being created, you will need to have a function called EA_OnPostNewElement. Search the help for "EA_OnPostNewElement" and it should point you in the right direction.

Automation Interface, Add-Ins and Tools / Re: Link restrictions
« on: September 25, 2017, 09:04:55 am »
The quicklinker can suggest valid connections but can't prevent invalid connections. You can write an add-in that implements the EA_OnPreNewConnector broadcast handler to prevent invalid connections, or you can write a validation script or add-in to report on invalid connections in your models.

To avoid having to hide the component icon, have you considered extending UML::Class instead of UML::Component? A UML Component is basically a Class with required and provided interfaces, and EA allows you to add required and provided interfaces to Classes anyway, so you wouldn't lose any functionality.

The Extended Requirements page contains a bunch of stereotyped Requirements, but they are not "UML::xxx".


The rest follow the same pattern. If you get stuck, create one in an empty model and then look in t_xref for a definition like this


It would have been nice to get feedback from Sparx in this forum.

If you aren't getting the answers you need from this user forum, you can contact Sparx Support. Use the "Report a Bug" link at the bottom of this page.

Firstly an aside
I don't want to start a war on whether VBScript has types or not but the following didn't work in my in-EA script
Code: [Select]
Dim myString As String
I got "Expected end of statement". I would have thought String was a simple enough type for VBScript to handle. Removing "As String" worked. I also note that "Dim myString As EA.Attribute" worked. Did I define a string wrongly? Either way, it was the "catch type-related errors" that I was after so I couldn't use VBScript.

"Dim myString As EA.Attribute" isn't typing myString, it's just letting EA's intellisense know. "Dim myString As String" fails because EA's intellisense doesn't know about Strings, just the EA Object Model.

Bugs and Issues / Re: SysML Item Flow with item property
« on: August 15, 2017, 09:13:54 am »
Ah, OK. ItemFlow has a tagged value named itemProperty. Set that to reference a Property.

But still I can not understand - I save it as a profile and generate my own MDG Tech. How it will be applied to the other technologies (Archimate 2)?

For redefined stereotypes, you have to go to the MDG Technologies dialog, select your technology and click the "Set Active" button. Then you can carry on using the Archimate 2 technology and your modifications will apply to it.

My new tag will be applied to new elements, but for the other elements that I have already created it won't ne applied. How can I apply my changes to the already existing elements of my customized technology?

Right-click your stereotype in the Diagram Toolbox and select "Synchronize Stereotype". It will update all tagged values in all existing elements with that stereotype.

Or you extend them in your own MDG thereby adding whatever tagged values you need.

Alexey, you don't say which version of EA you are using. Hopefully it is a recent version, because the functionality to do what you want to do was added at EA 13.0

You can add tagged values to an existing stereotype by using the redefines Generalization. See the help file topic "redefine_ster_other_prof" (ribbon|Start|Help|Go to Help Topic, and paste "redefine_ster_other_prof" into the dialog - without the quotes).

You will need an abstract stereotype "Archimate2::ArchiMate_ApplicationComponent" and a stereotype "ArchiMate_ApplicationComponent", with a redefines Generalization between them. The stereotype "ArchiMate_ApplicationComponent" will hold the additional tagged value declarations. Once you have built and deployed your technology, you will need to set the technology "Active" after which every Archimate2::ArchiMate_ApplicationComponent you create should have the additional tagged values you defined. Synchronizing tagged values should add them into all existing elements.

I hope this helps.

But how to extend class so that the default scope for its attributes (and operations too) is public instead of EA default of private?

There is no setting for this. The only solution would be to write an add-in that implements the EA_OnPostNewAttribute broadcast handler.

_AttPub has no meaning in a Toolbox Profile.

Use _AttPub in a UML Profile. If you have a stereotype that extends Class (for example), you might set _AttPub to "0" in order to hide all public attributes owned by the stereotyped Class (by default, EA shows all attributes).

Pages: 1 ... 4 5 [6] 7 8 ... 167