Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: shimon on January 04, 2024, 06:16:28 pm
-
Hi,
I would like to create a document of a Subsystem and include specific features (attributes and operations) from other Subsystems.
Is there an easy way to drag a Class onto a diagram, choose which properties are visible in this diagram, and produce a detailed report on these visible elements?
If there is no easy way, how can I use a SQL query and take into consideration the current diagram or Package ( as a parameter, I guess??) ?
Sincerely,
Shimon
-
There is no easy way.
It is possible with an SQL fragment, but not trivial.
Fragments can use objectID or PackageID as parameter.
Geert
-
You could create a script for that. Generating a document by script provides a huge flexibility.
Below I provided a small script, which documents a single element by (ElementID).
It uses a template with name "Test_Element". So you need to create a template under "Resources -> Document Publishing -> Custom Templates".
In the template you can select for example section "Element", "Attribute" and "Method".
!INC Local Scripts.EAConstants-JScript
/*
* Script Name:
* Author:
* Purpose:
* Date:
*/
function main()
{
docGenerator = Repository.CreateDocumentGenerator();
if (docGenerator.NewDocument("")) {
docGenerator.DocumentElement(188685, 0, "Test_Element");
docGenerator.SaveDocument("C:\\Temp\\Test_Element.docx", dtDOCX);
}
}
main();
-
You can write a macro in excel to read the class and its various properties from the diagram that is open (Active diagram) or open the desired diagram and loop through the classes / objects within the diagram to capture the information in excel spreadsheet. Let me know if that is what you are looking for and I can share the code snippet.
Regards,
Arun
-
Thanks, Jan. I will try this to see how it works.
-
Arun,
I am indeed interested to see how this functionality works.
Sincerely,
Shimon