Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: shimon on January 04, 2024, 06:16:28 pm

Title: Report only features that are visible on diagram
Post 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
Title: Re: Report only features that are visible on diagram
Post by: Geert Bellekens on January 04, 2024, 07:51:32 pm
There is no easy way.

It is possible with an SQL fragment, but not trivial.

Fragments can use objectID or PackageID as parameter.

Geert
Title: Re: Report only features that are visible on diagram
Post by: Jan van Duuren on January 05, 2024, 01:25:53 am
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".

Code: [Select]
!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();
Title: Re: Report only features that are visible on diagram
Post by: Arun8006 on January 10, 2024, 03:58:30 pm
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
Title: Re: Report only features that are visible on diagram
Post by: shimon on February 01, 2024, 05:53:56 pm
Thanks, Jan. I will try this to see how it works.
Title: Re: Report only features that are visible on diagram
Post by: shimon on February 01, 2024, 05:54:16 pm
Arun,
I am indeed interested to see how this functionality works.
Sincerely,
Shimon