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 - KristoferG

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Re: OnPreNewConnector
« on: December 08, 2015, 09:17:28 pm »
Is that available in a Work Flow script? I see it in the documentation for EA_OnPreNewConnector when developing an add-in, but I cannot figure out how to get it from a Work Flow script.

2
Automation Interface, Add-Ins and Tools / OnPreNewConnector
« on: December 08, 2015, 06:56:30 pm »
Hi!

I want to implement a rule in our model that in order to be able to create a connector between two elements, you require edit permissions on both elements (we are using group locking on packages) or else you should get a warning (but can still create it). So I figured that a Work Flow script should be a fairly simple solution. But I cannot see any way to get the elements involved when creating the connector. Is there any?

Or should I implement this in another way?

3
We are using the color to indicate that in this particular diagram, the class is not really part of that model, and are defined elsewhere. So the class has different colors in different diagrams, hence the DiagramObject carries the information, and not the class element.

The DocumentGenerator class does not properly (or i can't understand it) work with scaling and page format. If I use the Generate Documentation (F8) it works fine.

It also seems that when I use the DocumentGenerator class, I cannot omit rows (table row with label and custom field) in the template that are empty. According to the documentation, a bookmark with .Begin and .End should do what I want, but I can't get it to work when I call DocumentCustomData(...) with my template.

Code: [Select]
docGenerator.DocumentCustomData(GetClass(currentElement.ElementID), 0, "LM Objekttypskatalog - Klass");


/Kristofer

4
Thanks! That actually works!

The reason why I am using the DocumentGenerator class is that I want the user to be able to right click on a diagram in Project browser, and select to generate a report on that diagram. But, not the whole diagram, only some classes in that diagram based on its color in that diagram.

Any suggestions how to accomplish this without using the DocumentGenerator class, since it seems a little bit buggy (still can't figure out how to set the page format and scale the image to fit that page)?

/Kristofer

5
Hi!

I am generating a report using the DocumentGenerator class (a jscript), but I cannot figure out how to add a page header.

The code looks like this:
Code: [Select]
var docGenerator as EA.DocumentGenerator;
docGenerator = Repository.CreateDocumentGenerator();
docGenerator.NewDocument("LM Objekttypskatalog");      

var generationSuccess;
      
generationSuccess = docGenerator.DocumentDiagram(diagram.DiagramID, 0, "LM Objekttypskatalog - Diagram");

// some more code
docGenerator.DocumentCustomData(GetClass(currentElement.ElementID), 0, "LM Objekttypskatalog - Klass");

// and some more code

var saveSuccess;
saveSuccess = docGenerator.SaveDocument(OUTPUT_FILE, DOCUMENTATION_TYPE );

The template "LM Objekttypskatalog" contains a header, but none of the other templates (they are template fragments).

How do I add a page header to the generated document?

6
That's great to hear!

7
That's sad. :-(

Ideally, I want to generate the documentation together with our generation of HTML, and it is not tempting to edit each and every document each time we publish a new website (with 10+ diagrams).

It kind of defeat the purpose of having DocumentGenerator to automate the generation process, if we need to edit the document manually afterwards anyway. I hope they fix this soon.

/Kristofer

8
Hi!

When I am using docGenerator.DocumentDiagram(...) the diagram image is in full size and "cut" if it does not fit the page (A4 Portrait). If I use the "Generate Documentation" dialog with the same template, the image is scaled to fit the page (adopting to A4 Portrait).

Is it possible to:
1) Use the diagram properties to insert the image on a page with the proper format? (preferable since we always set this to fit the diagram)
2) Scale to fit the page?



9
Hmm, I am still trying to figure out how this works. It seems that when the connector style is custom, sx/sy and ex/ey is correct. But when the line is orthogonal (rounded if that makes any difference), sx/sy and ex/ey is not correct.

I cannot really make any sense of this. In one case I have been playing around with (for a few hours), either sx or ex was correct and it depended on the direction of the connector. Or put in other words, the offset from the center was correct for one of the elements, but the value was either in sx or ex, and I cannot find any way to know which one to look at. Or perhaps this is just a red herring. Frustrating however.

Anyone knows if they have been working in this area in EA 12 so I should update to EA 12 (currently using EA 11) and keep trying to figure out how this works?

/Kristofer

Edit: In the above I mean a straight line with the style set to orthogonal.

10
Automation Interface, Add-Ins and Tools / Re: Coordinates of connectors
« on: February 01, 2015, 05:28:22 am »
Yes, that's true, the Path gives the coordinate's of the bends. And you just gave me an idea.

If Path is empty, it is is a straight line, and sx/sy should be reliable to use, from what I have seen so far in my testing.

If Path is not empty, the first coordinate will be the first bend, and since we use orthogonal connectors, either the x coordinate or the y coordinate is the same where the connector attaches to the object.

So all I need to figure out is where the connected object is, related to this bend (it will be either to the right, left, above or below).

I hope this will work for us. Time will tell when I put this into code next week.

*crossing fingers*

/Kristofer

11
Automation Interface, Add-Ins and Tools / Re: Coordinates of connectors
« on: January 30, 2015, 09:38:02 pm »
I have filed a bug report now.

/Kristofer

12
Automation Interface, Add-Ins and Tools / Re: Coordinates of connectors
« on: January 30, 2015, 06:27:52 pm »
Sorry for the lenghty post, put i wanted to include images and what i observe in the database.

This is a simple scenario where you notice that sx is not reliable to use, and ex is somehow involved, but at the same time not...

Step 1: I drag two existing classes onto the diagram and save. In database I have:
Code: [Select]
DiagramID;ConnectorID;Geometry;Style;Hidden;Path;Instance_ID;
80;8;EDGE=1;$LLB=CX=18:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LLT=;LMT=CX=54:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LMB=;LRT=;LRB=CX=6:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;IRHS=;ILHS=;;Mode=3;EOID=5C7A0CBE;SOID=104C56E5;Color=-1;LWidth=0;;False; ;31;


Step 2: I change line style to "Orthogonal rounded" and save
Code: [Select]
DiagramID;ConnectorID;Geometry;Style;Hidden;Path;Instance_ID;
80;8;EDGE=1;SX=0;SY=0;$LLB=CX=18:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LLT=;LMT=CX=54:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LMB=;LRT=;LRB=CX=6:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;IRHS=;ILHS=;;Mode=3;EOID=5C7A0CBE;SOID=104C56E5;Color=-1;LWidth=0;TREE=OR;;False; ;31;


Step 3: I move the connector (dragging on the vertical line) and save
Code: [Select]
DiagramID;ConnectorID;Geometry;Style;Hidden;Path;Instance_ID;
80;8;EDGE=1;SX=-64;SY=28;EX=-1;EY=0;$LLB=CX=18:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LLT=;LMT=CX=54:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LMB=;LRT=;LRB=CX=6:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;IRHS=;ILHS=;;Mode=3;EOID=5C7A0CBE;SOID=104C56E5;Color=-1;LWidth=0;TREE=OR;;False;352:-251;;31;


Step 4: I move the connector again, but this time dragging on the horizontal line, and save
Code: [Select]
DiagramID;ConnectorID;Geometry;Style;Hidden;Path;Instance_ID;
80;8;EDGE=1;SX=-64;SY=28;EX=-44;EY=-5;$LLB=CX=18:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LLT=;LMT=CX=54:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LMB=;LRT=;LRB=CX=6:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;IRHS=;ILHS=;;Mode=3;EOID=5C7A0CBE;SOID=104C56E5;Color=-1;LWidth=0;TREE=OR;;False;309:-256;;31;


Step 5: I move the source object 1 pixel to the right and save
Code: [Select]
DiagramID;ConnectorID;Geometry;Style;Hidden;Path;Instance_ID;
80;8;EDGE=1;SX=-64;SY=28;EX=-44;EY=-5;$LLB=CX=18:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LLT=;LMT=CX=54:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LMB=;LRT=;LRB=CX=6:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;IRHS=;ILHS=;;Mode=3;EOID=5C7A0CBE;SOID=104C56E5;Color=-1;LWidth=0;TREE=OR;;False;335:-256;;31;


Notice that from step 3 (i have moved the connector for the first time), sx and sy stayes the same, although graphically, the connector is positioned at three different locations relative to the source object. I would have expected sx to be changed.

Any idea how i could figure out the start coordinates in the above scenario? I am stunned.

13
Automation Interface, Add-Ins and Tools / Re: Coordinates of connectors
« on: January 30, 2015, 02:08:48 am »
This is where i save and then check the database (we are using Oracle as repository, and I use SQL in EA to check the database):

- After I move the connector to another edge (i can see that the EDGE value is changed).

- After I move the object (i see no change to sx/sy nor EDGE in the database).

/Kristofer


14
Automation Interface, Add-Ins and Tools / Re: Coordinates of connectors
« on: January 30, 2015, 01:44:45 am »
Hi again!

I had a look in Inside Enterprise Architect and there is a lot of great information that i will need now and in the future, and some other things that I got confirmed. Great to have something to read instead of guessing and testing.

But I am still confused of the connector coordinates.

The following scenario is probable the reason for my confusion.

If I move the connector position at the start object to another edge of the start object, sx and sy changes (expected). But the values of sx/sy does not necessarily correlate to the graphical position I see in EA or in a saved image.

If I after this move the start object  1 pixel, sx/sy stays the same (expected since I do not change the position of the connector on the object), but the graphical representation of the connector start position is moved (not expected since i only moved the object).

Now sx/sy correlate to the actual graphical position of the connector.

So my conclusion is that I cannot only use sx/sy (and probably the same for ex/ey) to be sure of the position. It works sometimes, and is sometimes broken, and there has to be something else somewhere that is also involved. But what?

It seems that EA knows the connector position all the time (since you can click on it in the GUI), even after closing the application and making sure nothing is cached somewhere. So the information is there somewhere...


/Kristofer

15
Automation Interface, Add-Ins and Tools / Coordinates of connectors
« on: January 29, 2015, 05:50:22 pm »
Hi!

We need a more customized website than what we can get with the built-in html generator. One of the features we need/want are clickable connectors (to show the connector information).

So I have been looking at the DiagramLinks class, and the two attributes Geometry and Path, and Path gives me the coordinates of the bends.

In Geometry there is SX, SY, EX and EY, which seems to give the position of the connector on the connected DiagramObject, related to that DiagramObject's center position.

At first it seemed that SX and SY gave me the position on the source object, but that is not always true. Sometimes when I reposition the connector and think that SX should be changed, it instead changes EX.

Is there any explanation somewhere to how I cand find the coordinates of each connector on a diagram, so I can build a html map area based on it?

Or, if it is easier, to get the position of the name of the connector, to make the name clickable.

/Kristofer

Pages: [1]