Book a Demo

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.


Topics - MalkContent

Pages: [1]
1
Hi.
After having some trouble deleting the new connector in it's OnPostNew Event (which is done by saving the diagram right after the deletion from its clients/suppliers Connectors collection - careful, you have to iterate through the clients/suppliers-package.diagrams and save all those, since connector.DiagramID is 0) - I still have trouble to modify the connectors direction.
The connector in question is a custom stereotype from a mdg technology which has .Direction = "Unspecified" by default. When I modify the direction in the OnPostNewConnector Event-Method I can see the chosen direction 'blink' up for a splitsecond and then it's set back to the default "Unspecified".
It really gives me some trouble since I can change stuff like name, stereotypes, etc. but not the direction (also deletion is a bit more troublesome than usual).

Any ideas would be appreciated =).

2
Automation Interface, Add-Ins and Tools / Adding a diagram through code
« on: February 27, 2010, 04:28:46 am »
Hi.
I am having some problems adding a diagram to my model by code.
The diagram is added in the "EA_OnPostNewMethod" method and is added as a child of a class element.

This is my code:
Code: [Select]
                               EA.Diagram fledgedDiag = (EA.Diagram)(methparent.Diagrams.AddNew(meth.Name, "MOFSDM::mofsdmDiagram"));
                                fledgedDiag.Update();
                                methparent.Diagrams.Refresh();
                                methparent.Refresh();
                                package.Diagrams.Refresh();
                                package.Elements.Refresh();

methparent is the class element which the method is added to, meth is the new method and package is the package which methparent is located in.

Now to my problem:
It works - but it keeps stating the error "An invalid argument was encountered.".
The code which seems to be responsible for this error is "fledgedDiag.Update()" but the code doesn't work without it.

Did I mess up the order of refreshing/updating or did I forget something?

3
Hi,
I am currently trying to get a self made diagram (done via diagram profile) to add an element to the repository when an instance of it is created.

Is there a possibility to make it happen via profile editing?
And if not:
-how do I create Elements in the Repository
-how do I add Elements to the Diagram

I honestly searched a lot for the element creation and adding to a diagram thing and I tried a few things, but so far no luck.

EA.Element doesn't seem to posess a visible creator so I guessed it only could be added by methods of the Repository.

And as for the adding it to the diagram part, I am guessing it's done via the elements taggedvalues attribute, but I am not sure and don't know how it would be done.

Help :(

4
Hi.
I am trying to write an addin which prevents the creation of Activities within Activities.
For this I need to know the ParentID of the new Elements(to make sure, that, should the new Element be an Activity, it's parent isn't one), which should be available via the EventProperties.
But for some reason the EventPropertie which should hold the ParentID is always zero :/

Did I missunderstand the Parent Property  or is there something wrong >.>?

5
Automation Interface, Add-Ins and Tools / Custom QuickLink Problems
« on: December 05, 2009, 09:54:33 pm »
Hello,
I have been messing around with the creation of a new MDG technology to create a new toolbox for myself.
I have defined a set of stereotypes for classes and transitions and wanted to redefine the QuickLink option, following the instructions given in EA's help.

I now have a DocumentArtifact named QuickLink within the Diagram where in I defined both the stereotypes for classes and transitions.
The following lines are the contents of said DocArtifact:

Code: [Select]
Object,MOFSDMElements::mofsdmObject,Object,MOFSDMElements::mofsdmObject,,Object,MOFSDMElements::mofsdmObject,Assosiaction,,directed,,,TRUE,TRUE,,TRUE,,0,,,,,
ActivityInitial,MOFSDMElements::mofsdmStart,Activity,MOFSDMElements::mofsdmActivity,,Activity,MOFSDMElements::mofsdmActivity,Controlflow,,directed,,,TRUE,TRUE,,TRUE,,0,,,,,
Activity,MOFSDMElements::mofsdmActivity,Activity,MOFSDMElements::mofsdmActivity,,Activity,MOFSDMElements::mofsdmActivity,Controlflow,,directed,end,,TRUE,TRUE,,TRUE,,0,,,,,
Activity,MOFSDMElements::mofsdmActivity,ActivityFinal,MOFSDMElements::mofsdmStop,,Activity,MOFSDMElements::mofsdmActivity,Controlflow,,directed,,,TRUE,TRUE,,TRUE,,0,,,,,
ActivityFinal,MOFSDMElements::mofsdmStop,Activity,MOFSDMElements::mofsdmActivity,,Activity,MOFSDMElements::mofsdmActivity,Controlflow,,from,,,TRUE,TRUE,,TRUE,,0,,,,,

Perhaps someone can tell me what I am doing wrong, because at the moment the quicklinks of my stereotypes seemingly are not affected at all.

Pages: [1]