Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Jeronimo on January 03, 2011, 11:15:32 pm
-
Hello,
I try to generate automatically some Activity Diagrams, but I see
no way how to create a ActivityInitial and a ActivityFinal node...
I thought I can specify this by the attribute "type" of the element.
But "ActivityInitial" and "ActivityFinal" is no valid type...
Is there any way to create this elements?
bests,
Jeronimo
-
Create a StateNode with subtype = 100 for ActivityInitial and 101 for ActivityFinal
Geert
-
Dear Geert,
thank you very much for your quick help! :)
-
I managed to add ActivityInitial and ActivityFinal to an ActivityDiagram. Is there a way to move those elements to a dedicated position? If I readout diagramObject.left, diagramObject.right, diagramObject.top, diagramObject.bottom of those element it simply returns 0,0,0,0.
-
I managed to add ActivityInitial and ActivityFinal to an ActivityDiagram. Is there a way to move those elements to a dedicated position? If I readout diagramObject.left, diagramObject.right, diagramObject.top, diagramObject.bottom of those element it simply returns 0,0,0,0.
In its wisdom, EA returns (or at least used to, haven't checked lately) the position last saved to disk, not the position on the live diagram. So if you haven't saved the element yet, you'll get what you see.
Paolo
-
The easiest way is to create the diagramobject with the position string as name.
Something like DiagramObjects.AddNew("l=10;r=200;t=20;b=250", "")
Or update the left/right/top/bottom fields and remember to call Update() to save it to the database
Geert
-
I could meanwhile find out the initial size of ActivityInitial and ActivityFinal
should be left= 10;right= 30;top = -10;bottom = -30;
-
For those wondering. If you select an element on a diagram, you can see it's exact coordinates on the bottom left.
Geert
-
For those wondering. If you select an element on a diagram, you can see its coordinates on the bottom left.
Geert
Are these the same values returned by the API? Or is it still as it used to be that the API only returns the saved values?
Paolo
-
I would "guess" that it's the value from the database and not a life value. You could just have tried this with a little script ;-)
q.
-
I would "guess" that it's the value from the database and not a life value. You could just have tried this with a little script ;-)
q.
I did! But my code is nearly a decade old, so it may not be accessing the "latest and greatest".
Paolo
-
I would "guess" that it's the value from the database and not a life value.
It's updated live while dragging an object.
-
I would "guess" that it's the value from the database and not a life value.
It's updated live while dragging an object.
The values on screen are, but are the values supplied via the API? As I mentioned, our code (C# in an add-in) returns only the values last saved, regardless of the position of the item on the screen.
Paolo
-
Yes. I interpreted the comment that I replied to as being about the position displayed in the status bar and was responding only to that comment.
-
Yes. I interpreted the comment that I replied to as being about the position displayed in the status bar and was responding only to that comment.
Now you made me stumble. Paolo was alking about the API and I was responding to the API behavior. Now you get back to that display on the screen?
q.
-
I ran a test. My guts were right: it does NOT dynamically return the current position but only the last saved one. It's V15 but would guess (again) that V16 is the same.
q.
-
I ran a test. My guts were right: it does NOT dynamically return the current position but only the last saved one. It's V15 but would guess (again) that V16 is the same.
q.
We already know that don't we? That's how the whole API works.
The GUI and the API are basically two applications that run next to each other with very little communication.
Geert
-
Well, like Einstein's Relativity this needs a proof now and then...
q.