Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 689 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Export to Excel from a Diagram Enterprise Architect

#1
I'm starting to work with Enterprise Architect and I need to make a script to export all use cases and notes, from a diagram to Excel.
However, the provided CSV export only works for packages, not for diagrams like this:

[![enter image description here][1]][1]

If I use the option "view as list", the diagram will show all use cases.
I need something like that, but with Notes, and exported to CSV/Excel.

[![enter image description here][2]][2]


[1]:

[2]:
Reply

#2
The only thing you need to do is to relate the export script to the diagram in question. The easiest would be to access the diagram with

var dia = Repository.GetCurrentDiagram();

which returns the object for the currently open diagram.

The next is to scan the diagram objects and finding the use cases:

var dObjs = dia.DiagramObjects; // collection of diagram objects
for (var i = 0 ; i < dObjs.Count ; i++) {
var dObj = dObjs.GetAt(i); // current diagram object
var obj = Repository.GetElementByID (dObj).ElementID; // related element
if (obj.Type == "UseCase") { // only interested in UCs
// this is a UC to export; do the magic here
}
}

Please note that the above was just written out of my head and might have syntax errors. But basically that's the way to go.

N.B.: The required csv export is easiest accomplished by using EAScriptLib's JScript-CSV.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through