I've never found an easy way to do this, and Geert's suggestion would make it easy. But I've never found such options.
I document specific diagrams with 'Document Script'.
- I have a template with a fragment
- The fragment uses Custom Query -> Document Script
- Document Script selects and calls a script which contains the logic to document correct diagram
To get you started with the Document Script:
Create a EA.DocumentGenerator:
https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/document_generator_interface_class.htmlRepository.CreateDocumentGenerator();
Create the logic to find the correct diagram, then use 'DocumentDiagram(...)' from the link above.
Generate as RTF:
GetDocumentAsRTF();
A limitation with this approach if using SQL search on the Model Document, is that you must search for an element (as far as I know).
So what I do is usually have an guid-based search for element, then find diagram occurences, or child diagrams in the script, with if statements for types names etc to find my diagram of choice.
The Document Script input parameters I usually have main(objectID, diagramName/diagramType/whatever). Sometimes depending on occasion I only have main(objectID), or main(diagramID).
This seems a bit complicated for just documenting a specific diagram. But this is how I do it.
I have Document Scripts for different scenarios:
- showDiagramOfType
- showDiagramOfName
Or just have diagrams in seperate packages, but is not always optimal/wanted.